Skip to content

make test_ridge_regression_vstacked_X less sensitive - #23152

Merged
jeremiedbb merged 4 commits into
scikit-learn:mainfrom
MaxwellLZH:fix/fail-ridge-test
Apr 20, 2022
Merged

jeremiedbb merged 4 commits into
scikit-learn:mainfrom
MaxwellLZH:fix/fail-ridge-test

Conversation

@MaxwellLZH

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

This is a fix to issue #23151 .

What does this implement/fix? Explain your changes.

The test error is raised due to the relative difference on a small coefficient, this PR sets atol=1e-3 to avoid such cases.

AssertionError:
Not equal to tolerance rtol=1e-07, atol=0

Mismatched elements: 1 / 3 (33.3%)
Max absolute difference: 7.17563786e-11
Max relative difference: 3.62417193e-06
x: array([-3.677719e+00, -9.925325e-06,  3.448643e+00])
y: array([-3.677719e+00, -9.925289e-06,  3.448643e+00])

@jeremiedbb

Copy link
Copy Markdown
Member

Related to #23017.

Although I think that setting atol is the thing to do as I commented there, 1e-3 seems way too high to me. We want to keep the rtol=1e-7 check for the coefs that are ~1. I'd rather set atol=1e-8.

@jeremiedbb jeremiedbb added this to the 1.1 milestone Apr 19, 2022
@lorentzenchr lorentzenchr linked an issue Apr 20, 2022 that may be closed by this pull request
@lorentzenchr

Copy link
Copy Markdown
Member

Related to #23017.

I'd say it's a duplicate of #23017 for solving #23014. #23017 also increases the fitting tolerance for sag and saga as in the other tests.

@ogrisel

ogrisel commented Apr 20, 2022

Copy link
Copy Markdown
Member

Related to #23168.

test_ridge_regression_unpenalized_vstacked_X
test_ridge_regression_vstacked_X

@jeremiedbb jeremiedbb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @MaxwellLZH

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.

test_ridge_regression_vstacked_X is not stable

4 participants