-
-
Notifications
You must be signed in to change notification settings - Fork 26k
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
MNT Add validation of scalar parameters in Ridge #21341
Conversation
Also corrects validation for alpha
525b117
to
88a2244
Compare
d4112e0
to
fe56c15
Compare
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.
Just a few comments; apart from those, this looks good to me.
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]>
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 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.
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.
It looks good but I would prefer to merge the PR moving the validation first.
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 once the conflicts with main
are solved. Thank you, @ArturoAmorQ!
@ArturoAmorQ Could you solve the conflict? We will be able to merge this one. |
Co-authored-by: Julien Jerphanion <[email protected]>
Co-authored-by: Julien Jerphanion <[email protected]> Co-authored-by: Olivier Grisel <[email protected]>
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
fromsklearn.utils
to validate scalar parameters and making sure to get consistent error types and messages inlinear_model.Ridge
Any other comments?
Happy to contribute to the scikit-learn project for the first time!