You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to how GridSearchCV is designed (use of clone, parallelism with n_jobs), setting the warm_start option wouldn't have any effect.
It would be nice to create a grid search object which can benefit from warm-start. n_jobs could still be supported but should be with respect to cross-validation folds.
This would require specifying with respect to what parameters the warm-starting must be done (e.g., alpha in the case of Lasso).
Actually my proposal would not work via the "warm_start" option, but place the whole logic of how to compute a path in the estimator, not GridSearchCV. The idea would be to make it possible for GridSearchCV to discover for wich parameters there is a path option and let it give a list / grid to the estimator.
So for example Lasso could have an attribute lasso.generalized_cv_params = ['alpha'].
GridSearch will see that and pass the whole list of alphas to lasso.
Then lasso will compute the scores for all alphas for a given fold.
I'm not sure putting the work into the estimator is better than into GridSearchCV. I do think this is an important api issue and we should not scatter the discussion into multiple issues ;)
If there are more than one parameters that support warm_start (say max_depth and n_samples_split in the trees), GridSearchCV would need to know the correct sequence to take full advantage of the redundancy. I'm not sure that is a good idea. But maybe I'm thinking of overly complex cases.
+1 for the idea of making use of warm-start in GridSearchCV. #1626 doesn't seem to address this directly, and considering that there hasn't been any movement on it in 5 years, would you be willing to reopen this issue, or should I submit a new related one?
My use case is to make use of the warm_start option for RandomForestClassifier. This would require some coordination of the jobs sent to run in parallel, but it should be doable, right?
Activity
amueller commentedon Feb 11, 2013
Isn't this basically what I propsed in #1626, where I also proposed a solution?
amueller commentedon Feb 22, 2013
Do you agree this is a duplicate?
mblondel commentedon Feb 22, 2013
Could you illustrate how your proposal in #1626 would be applied to solve warm-start aware grid-search?
amueller commentedon Feb 22, 2013
Actually my proposal would not work via the "warm_start" option, but place the whole logic of how to compute a path in the estimator, not GridSearchCV. The idea would be to make it possible for GridSearchCV to discover for wich parameters there is a path option and let it give a list / grid to the estimator.
So for example
Lassocould have an attributelasso.generalized_cv_params = ['alpha'].GridSearch will see that and pass the whole list of alphas to
lasso.Then
lassowill compute the scores for all alphas for a given fold.I'm not sure putting the work into the estimator is better than into
GridSearchCV. I do think this is an important api issue and we should not scatter the discussion into multiple issues ;)amueller commentedon Feb 22, 2013
If there are more than one parameters that support
warm_start(saymax_depthandn_samples_splitin the trees), GridSearchCV would need to know the correct sequence to take full advantage of the redundancy. I'm not sure that is a good idea. But maybe I'm thinking of overly complex cases.amueller commentedon Feb 22, 2013
Maybe using
RFEtogether withSGDClassifieris a less far-fetched example.mblondel commentedon Feb 23, 2013
Thanks, your idea is much clearer now.
On Feb 23, 2013 8:46 AM, "Andreas Mueller" [email protected] wrote:
amueller commentedon Sep 29, 2016
@jnothman you think this is covered by #1626 or you think this is better described elsewhere?
jnothman commentedon Sep 30, 2016
I think it is covered by #1626, partially addressed by model-specific CV
estimators, and beyond that not clear enough to be easily addressed.
On 30 September 2016 at 05:10, Andreas Mueller [email protected]
wrote:
robguinness commentedon Nov 6, 2018
+1 for the idea of making use of warm-start in GridSearchCV. #1626 doesn't seem to address this directly, and considering that there hasn't been any movement on it in 5 years, would you be willing to reopen this issue, or should I submit a new related one?
My use case is to make use of the warm_start option for RandomForestClassifier. This would require some coordination of the jobs sent to run in parallel, but it should be doable, right?
jnothman commentedon Nov 6, 2018
@robguinness, #8230 might be the sort of thing you're looking for... not that we have come to consensus on how much we like it.