Open simbol01 opened 4 years ago
I got the same error
Thanks for your feedback. The best_estimator_
attribute ends with an underscore. In Scikit-Learn, this means that it's a learned parameter, so it's only available after the fit()
function finishes successfully. If there was an error during training, or if you interrupted training, then this attribute will not be present.
Note that the RandomizedSearchCV
's fit()
function will first look for the best hyperparameter values and then (if refit=True
, which is the default) it will train a final model on the whole training set (instead of a cross-validation subset as during the hyperparameter search). So if the function was interrupted after the hyperparameter search but before the end of training the final model, it might be possible to have best_params_
defined, perhaps also best_score_
, but not best_estimator_
.
I hope this helps.
Note: just to make sure, I just ran the Colab Notebook for this chapter, and best_estimator_
worked fine, so I think the hypothesis above is correct (the fit()
function was probably interrupted before it finished).
Help please I got this error while trying to save my model after fine-tuning with RandomizedSearchCV. model = rnd_search_cv.bestestimator.model But I got the above error, any suggestions please?