пробовал grid.cv_results_ не решил проблему
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.grid_scores_
на grid.cv_results_
Цель состоит в том, чтобы напечатать различные комбинации значений гиперпараметров и средние значения ROC AUC, рассчитанные с помощью 10-кратной перекрестной проверки
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_'