tried grid.cv_results_ didnt correct problem
from sklearn.model_selection
import GridSearchCV
params = {
'decisiontreeclassifier__max_depth': [1, 2],
'pipeline-1__clf__C': [0.001, 0.1, 100.0]
}
grid = GridSearchCV(estimator = mv_clf,
param_grid = params,
cv = 10,
scoring = 'roc_auc')
grid.fit(X_train, y_train)
for params, mean_score, scores in grid.grid_scores_:
print("%0.3f+/-%0.2f %r" %
(mean_score, scores.std() / 2, params))
#AttributeError: 'GridSearchCV' object has no attribute 'grid_scores_'
tried replacing grid.grid_scores_
with grid.cv_results_
The objective is to print the different hyperparameter value combinations and the average ROC AUC scores computed via the 10-fold cross validation
from sklearn.model_selection
import GridSearchCV
params = {
'decisiontreeclassifier__max_depth': [1, 2],
'pipeline-1__clf__C': [0.001, 0.1, 100.0]
}
grid = GridSearchCV(estimator = mv_clf,
param_grid = params,
cv = 10,
scoring = 'roc_auc')
grid.fit(X_train, y_train)
for params, mean_score, scores in grid.grid_scores_:
print("%0.3f+/-%0.2f %r" %
(mean_score, scores.std() / 2, params))
#AttributeError: 'GridSearchCV' object has no attribute 'grid_scores_'
grid.cv_results_
works in the latest scikit-learn v0.20.1 (where indeed agrid_scores_
attribute does not exist) - check the documentation – Headcheese