Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MNT Add validation of scalar parameters in Ridge #21341

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 17 commits into from
Dec 1, 2021

Conversation

ArturoAmorQ
Copy link
Member

@ArturoAmorQ ArturoAmorQ commented Oct 15, 2021

Reference Issues/PRs

Solves a part of the Issue #20724 as mentioned in this comment

What does this implement/fix? Explain your changes.

Use the helper function check_scalar from sklearn.utils to validate scalar parameters and making sure to get consistent error types and messages in linear_model.Ridge

Any other comments?

Happy to contribute to the scikit-learn project for the first time!

@ArturoAmorQ ArturoAmorQ changed the title Add validation on regularization parameter MNT Add validation on regularization parameter Oct 19, 2021
@ArturoAmorQ ArturoAmorQ changed the title MNT Add validation on regularization parameter MNT Add validation of scalar parameters in Ridge and Lasso Oct 20, 2021
@ArturoAmorQ ArturoAmorQ changed the title MNT Add validation of scalar parameters in Ridge and Lasso MNT Add validation of scalar parameters in Ridge Nov 3, 2021
@ArturoAmorQ ArturoAmorQ force-pushed the validations_for_ridge branch from d4112e0 to fe56c15 Compare November 5, 2021 11:07
@ArturoAmorQ ArturoAmorQ marked this pull request as ready for review November 5, 2021 12:47
@jjerphan jjerphan self-requested a review November 9, 2021 14:46
Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

Just a few comments; apart from those, this looks good to me.

@jjerphan jjerphan requested a review from glemaitre November 9, 2021 20:43
ArturoAmorQ and others added 2 commits November 10, 2021 15:35
This change is indeed independent of `RidgeCV`. This commit adds an explanation on the need for a conditional statement during validation.

Co-authored-by: Julien Jerphanion <[email protected]>
Tweak to adopt conventions

Co-authored-by: Julien Jerphanion <[email protected]>
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 once the following comments are addressed.

I think this deserves a changelog entry in doc/whats_new/v1.1.rst in the linear_model section stating that Ridge and ridge_regression now raise consistent error message when passed invalid values for alpha, max_iter and tol.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

It looks good but I would prefer to merge the PR moving the validation first.

Copy link
Member

@jjerphan jjerphan left a comment

Choose a reason for hiding this comment

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

LGTM once the conflicts with main are solved. Thank you, @ArturoAmorQ!

@glemaitre
Copy link
Member

@ArturoAmorQ Could you solve the conflict? We will be able to merge this one.

@jjerphan jjerphan merged commit cacc034 into scikit-learn:main Dec 1, 2021
thomasjpfan pushed a commit to thomasjpfan/scikit-learn that referenced this pull request Dec 1, 2021
@ArturoAmorQ ArturoAmorQ deleted the validations_for_ridge branch March 30, 2022 15:47
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.

4 participants