Skip to content

Add a test to check the consistency of the Ridge and ElasticNet(l1_ratio=0) solutions #19620

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

Merged
merged 4 commits into from
Mar 17, 2021

Conversation

ogrisel
Copy link
Member

@ogrisel ogrisel commented Mar 5, 2021

This checks that the coordinate descent solver of ElasticNet converges to the same solution as the default cholesky solver of Ridge when ElasticNet is fit with l1_ratio=0. The value of the regularization parameter alpha needs to be adapted but this should be expected (see the docstring of respective models for more details).

This test was extracted from the draft #19616 PR. They should pass on the main branch so I think it's good to merge as a non-regression test without waiting for the rest of #19616 to be completed.

@agramfort it seems that the dual gap convergence criterion of ElasticNet is never met when fitting with l1_ratio=0. Not sure if this is expected or not. If not we should probably open a dedicated issue. If it is expected maybe we should change the ConvergenceWarning to advise the user about l1_ratio=0

Copy link
Member

@GaelVaroquaux GaelVaroquaux left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@TomDLT TomDLT merged commit fcf4740 into scikit-learn:main Mar 17, 2021
@ogrisel ogrisel deleted the test-ridge-enet-consistency branch March 17, 2021 10:53
@ogrisel
Copy link
Member Author

ogrisel commented Mar 17, 2021

Thanks @TomDLT and @GaelVaroquaux.

marrodion pushed a commit to marrodion/scikit-learn that referenced this pull request Mar 17, 2021
@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