-
-
Notifications
You must be signed in to change notification settings - Fork 26k
ENH add store_cv_models
option to ElasticNetCV
#28726
#31545
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Guilherme Henriques <[email protected]>
❌ Linting issuesThis PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling You can see the details of the linting issues under the
|
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'm not really sure if this is a good idea. It's adding quite a bit of computation to store the attributes, and to me it seems the user is better off doing a normal GridSearchCV
on ElasticNet
instead, to have all required attributes at this point.
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 changelog and the docstring should be enough, we probably don't need to make the user guide here longer.
Reference Issues/PRs
What does this implement/fix? Explain your changes.
This PR introduces a new optional parameter store_cv_models to ElasticNetCV.
When store_cv_models=True, the object retains all models trained during cross-validation — not just the best one. This enables users to access:
...for every combination of fold and hyperparameters.
This is useful for:
Default behavior remains unchanged (store_cv_models=False), preserving backward compatibility and avoiding unnecessary memory usage for most users.
Any other comments?
This addition offers deeper access to the training process for power users without affecting default performance.