Skip to content

FIX RuntimeWarning by dividing by zero in test_sanity_check_pls_regression_constant_column_Y #19480

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

Conversation

marenwestermann
Copy link
Member

Reference Issues/PRs

Towards #19334

What does this implement/fix? Explain your changes.

Fixes the RuntimeWarning caused by test_sanity_check_pls_regression_constant_column_Y in sklearn/cross_decomposition/tests/test_pls.py

Any other comments?

The array pls.y_loadings_ looks like this:
[[ 0. 0. 0. ]
[-0.43573004 0.58284789 0.21748017]
[ 0.13537388 -0.24864229 -0.18103859]]

Therefore, an error caused by division by zero occurs. I fixed the error but please let me know if this is a good solution or not.

#DataUmbrella sprint

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @marenwestermann , minor comment but LGTM

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well. Thank you for the fix @marenwestermann!

@ogrisel ogrisel merged commit b169bc0 into scikit-learn:main Feb 20, 2021
@marenwestermann marenwestermann deleted the test_sanity_check_pls_regression_constant_column_Y branch February 23, 2021 18:18
@glemaitre glemaitre mentioned this pull request Apr 22, 2021
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants