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
FIX add best_score_ to Ridge*CV estimators #15655
Conversation
Remove irrelevant things? I guess you're going to split that PR into multiple parts. |
@qinhanmin2014 OK, this should be easy to review now since there is only relevant information to be merged. |
@rth, @adrinjalali could you have a look at it as well. |
sklearn/linear_model/_ridge.py
Outdated
@@ -1693,6 +1695,9 @@ class RidgeCV(MultiOutputMixin, RegressorMixin, _BaseRidgeCV): | |||
alpha_ : float | |||
Estimated regularization parameter. | |||
|
|||
best_score_ : float | |||
Score of base estimator with best alpha on the hold out data. |
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.
the version from GridSearchCV seems better: "Mean cross-validated score of the best_estimator"
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 changed the docstring. However, I don't refer to best_estimator
because we don't have such attributes (while it is available in GridSearchCV).
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, thanks!
@@ -73,6 +73,10 @@ Changelog | |||
`store_cv_values` is `True`. | |||
:pr:`15652` by :user:`Jérôme Dockès <jeromedockes>`. | |||
|
|||
- |Fix| add `best_score_` attribute to :class:`linear_model.RidgeCV` and | |||
:class:`linear_model.RidgeClassifierCV`. | |||
:pr:`15653` by :user:`Jérôme Dockès <jeromedockes>`. |
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.
Maybe add yourself?
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 is fine :)
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 was originally @jeromedockes, I am just splitting the PR such that it is easy to review
closes #4667
closes #4790
Add
best_score_
attribute in Ridge*CV.Build on #15652