[scikit-learn] extraction of grid search values

Nicolas Hug niourf at gmail.com
Tue Jan 5 15:58:56 EST 2021


Glenn,

You need to fit the estimator with some data for the cv_results_ attribute
to exist. You may refer to
https://scikit-learn.org/stable/getting_started.html

Nicolas

On Tue, 5 Jan 2021 at 17:25, Glenn Schultz via scikit-learn <
scikit-learn at python.org> wrote:

> All,
>
> I have a grid search of gradient boosting classifier.  All works well the
> best model is extracted and predict works on the model.  I would like to
> extract the cv_results_  My set-up is pretty standard
>
> gbclassifier = GridSearchCV(GradientBoostingClassifier(),
>                         parameters,
>                         verbose = 5,
>                         n_jobs = 5,
>                         cv = ShuffleSplit(n_splits = 5, test_size = .2,
> random_state = 42),
>                         refit = True,
>                         scoring = “roc_auc”)
>
> print(gbclassifier.cv_results_)
>
> returns an attribute error ‘Gradient Boosting Classifier’ has no attribute
> cv_results.  I am not sure what I am doing wrong I checked the
> documentation and followed some SO examples but no progress.  I am missing
> something any help is appreciated.
>
> Best,
> Glenn
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/scikit-learn/attachments/20210105/444cb9f8/attachment.html>


More information about the scikit-learn mailing list