Do cross-validation estimators like LassoCV re-estimate the model on the full training set after finding the best hyperparameters? #20488
Comments
Answer: Yes, these estimators refit on the full training set. I agree this should be documented somewhere, for instance in the glossary, and in the docstring of each class. Details:
|
Hi, I would like to work on this issue. Please guide me further on what needs to be done. Thanks |
We should add at the top of the docstring of all the listed classes that the estimator refits the model on the full training set after finding the best hyperparameters (reminding the reader what the hyperparameters optimized in each class are). We should also add this as a general info in the glossary (see link above). |
Yes, After finding the optimal hyperparameters using cross validation , final model uses these optimal hyperparameters and refits on the whole training dataset, and you rightly mentioned it is no where documented. |
if this is not taken, I am happy to fix. Thank you |
You very welcome! |
Many Dhanyavadams! |
take |
Describe the issue linked to the documentation
The description of cross-validation estimator does not explain whether the final model parameters are estimated on the entire training set, using the optimal hyperparameter obtained through cross-validation.
Typically we use cross-validation to identify optimal hyperparameters (such as SVM or LASSO).
What needs to be clarified is, once the optimal hyperparameter is found via cross-validation (say c in SVM or alpha in LASSO), does say LassoCV, automatically re-estimate the model with the optimal alpha?
Suggest a potential alternative/fix
Simply add a note explaining whether the last re-estimation step using the entire training data occurs or not. Also any suggestions on obtaining the optimal hyperparameter found would also help.The text was updated successfully, but these errors were encountered: