The Wayback Machine - https://web.archive.org/web/20210823161514/https://github.com/scikit-learn/scikit-learn/pull/19646
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Fixes regression in CCA #19646

Merged
merged 8 commits into from Apr 22, 2021
Merged

FIX Fixes regression in CCA #19646

merged 8 commits into from Apr 22, 2021

Conversation

@thomasjpfan
Copy link
Member

@thomasjpfan thomasjpfan commented Mar 8, 2021

Reference Issues/PRs

Fixes #19549

What does this implement/fix? Explain your changes.

The regression was introduced in #18746. The original implementation depended on a previous version of pinv2 that was changed in scipy/scipy#10067, this PR pulls in the old version of pinv2. For now I am not considering _pinv2_old a "utils.fixes" because it is not a "fix" that we would remove in the future.

Any other comments?

It would be nice to have a non-regression test for this. So far I tested this on the dataset provided here: #19549 (comment)

@jnothman jnothman modified the milestones: 0.24.1, 0.24, 0.24.2 Mar 8, 2021
Copy link
Member

@ogrisel ogrisel left a comment

It would be nice to have a non-regression test for this. So far I tested this on the dataset provided here: #19549 (comment)

I agree it would be great to have a non-regression test that is sensitive to cond parameter of pinv2 to make sure that we do not break this again in the future.

sklearn/cross_decomposition/_pls.py Show resolved Hide resolved
@ogrisel
Copy link
Member

@ogrisel ogrisel commented Mar 15, 2021

For now I am not considering _pinv2_old a "utils.fixes" because it is not a "fix" that we would remove in the future.

Actually we could probably find a way to rewrite it as a fix that we would use in the future:

Backport the scipy 1.3+ version of pinv2 in sklearn.util.fixes (when the installed scipy is < 1.3) and use it with a cond value that does want we want.

Edit or maybe it's not possible to do so without computing the SVD in which case it's pointless...

@ogrisel
Copy link
Member

@ogrisel ogrisel commented Mar 15, 2021

Indeed we need a relative cutoff (which I believe rcond is for but was apparently always broken because it does the same as cond). I added a comment: scipy/scipy#10067 (comment)

@thomasjpfan
Copy link
Member Author

@thomasjpfan thomasjpfan commented Mar 19, 2021

I updated this PR with a non-regression test and moving the whats new to 0.24.2

Copy link
Member

@ogrisel ogrisel left a comment

LGTM! Thanks very much for the non-regression test.

@glemaitre glemaitre merged commit dbed806 into scikit-learn:main Apr 22, 2021
27 checks passed
27 checks passed
@github-actions
check
Details
@github-actions
check
Details
@github-actions
triage
Details
@github-actions
Check build trigger
Details
@github-actions
Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
Details
@github-actions
Source distribution
Details
@github-actions
Upload to Anaconda
Details
@lgtm-com
LGTM analysis: C/C++ No code changes detected
Details
@lgtm-com
LGTM analysis: JavaScript No code changes detected
Details
@lgtm-com
LGTM analysis: Python No new or fixed alerts
Details
ci/circleci: deploy Your tests passed on CircleCI!
Details
ci/circleci: doc Your tests passed on CircleCI!
Details
@circleci-artifacts-redirector
ci/circleci: doc artifact Link to 0/doc/_changed.html
Details
ci/circleci: doc-min-dependencies Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
@azure-pipelines
scikit-learn.scikit-learn Build #20210319.19 succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Get Git Commit) Get Git Commit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linting) Linting succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux py36_conda_openblas) Linux py36_conda_openblas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux py36_ubuntu_atlas) Linux py36_ubuntu_atlas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux pylatest_pip_openblas_pandas) Linux pylatest_pip_openblas_pandas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux32 py36_ubuntu_atlas_32bit) Linux32 py36_ubuntu_atlas_32bit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux_Runs pylatest_conda_mkl) Linux_Runs pylatest_conda_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Windows py36_pip_openblas_32bit) Windows py36_pip_openblas_32bit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Windows py37_conda_mkl) Windows py37_conda_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (macOS pylatest_conda_forge_mkl) macOS pylatest_conda_forge_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (macOS pylatest_conda_mkl_no_openmp) macOS pylatest_conda_mkl_no_openmp succeeded
Details
Copy link
Contributor

@glemaitre glemaitre left a comment

LGTM. Thanks @thomasjpfan

@glemaitre glemaitre mentioned this pull request Apr 22, 2021
10 of 12 tasks
@ilayn
Copy link

@ilayn ilayn commented Apr 24, 2021

Hi all, do you mind having a look at scipy/scipy#13831 and let me know if I'm missing anything else for your needs ?

This will first provide atol and rtol possibilities and then long overdue pinv2 deprecation cycle will start. Since I've caused so much annoyance which I apologize once again, I guess you should be the first premium customer of the feature 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants