Issue
I ran randomForestClassifier
using GridSearchCV
in colab.
However, myGridSearchCV
does not return mean_test_score and shows it does not exists.
When I tried to check clf.cv
results there is not mean_test_score.This works in Jupyter notebook not in Colab and I recently faced this issue.
[Parallel(n_jobs=1)]: Done 120 out of 120 | elapsed: 25.3min finished
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-128-1d8f6c95affb> in <module>()
7 clf.fit(X_tr, y_train)
8
----> 9 train_auc= clf.cv_results_['mean_train_score']
10 cv_auc = clf.cv_results_['mean_test_score']
KeyError: 'mean_train_score'
Solution
Actually you are getting mean_train_score
key error. Just set return_train_score=True
in gridsearchcv parameters and it will do the job.
Answered By - Akash Singh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.