-
-
Notifications
You must be signed in to change notification settings - Fork 26k
CI Fixes test_rank_deficient_design #21345
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
@ogrisel seems like we still have the scientific printing issue here. Could we please move to conda-forge? |
@@ -726,6 +727,9 @@ def _lars_path_solver( | |||
# orthogonal (QR) decomposition of X | |||
corr_eq_dir = np.dot(Gram[:n_active, n_active:].T, least_squares) | |||
|
|||
# Workaround for inconsistent rounding in openblas | |||
np.around(corr_eq_dir, decimals=cov_precision, out=corr_eq_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels more like symmetry breaking. Without this fix and on openblas 0.3.18, Cov
gets updated to:
Cov = [2.3809523809523814, 2.3809523809523814]
When g1
is computed (with min_pos
), it returns FLT_MAX
because C - Cov
is zero.
On openblas 0.3.17, Cov
is:
Cov = [2.380952380952385, 2.3809523809523814]
which is not symmetric, leading to a non FLT_MAX
value for g1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this what @lesteve and @glemaitre discovered just before leaving for the WE ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it was the case. Then, the wrong dimension will be picked and everything goes sideways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Maybe we could add a quick changelog entry for this fix.
@@ -726,6 +727,9 @@ def _lars_path_solver( | |||
# orthogonal (QR) decomposition of X | |||
corr_eq_dir = np.dot(Gram[:n_active, n_active:].T, least_squares) | |||
|
|||
# Workaround for inconsistent rounding in openblas | |||
np.around(corr_eq_dir, decimals=cov_precision, out=corr_eq_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this what @lesteve and @glemaitre discovered just before leaving for the WE ;)
Yes let's do it since it is happening again. I reopened #21324 and reported the problem upstream: ContinuumIO/anaconda-issues#12667 Edit: The switch to conda-forge is happening here: #21337. |
Co-authored-by: Olivier Grisel <olivier.grisel@gmail.com>
LGTM Thanks @thomasjpfan |
Co-authored-by: Olivier Grisel <olivier.grisel@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@gmail.com>
Reference Issues/PRs
Closes #21340
What does this implement/fix? Explain your changes.
This issue came down to:
scikit-learn/sklearn/linear_model/_least_angle.py
Line 722 in 47a49c5
where the
np.dot
had a slightly different result between openblas 0.3.18 and 0.3.17:On
openblas=0.3.18
, the above result was:[8.16496580927726, -0.4082482904638631]
On
openblas=0.3.17
, the above result was:[8.164965809277259, -0.4082482904638631]
This slight difference worked its way down to generating a slightly different
Cov
, which snowballed from there.