def test_cv_multiplemetrics_no_refit():
X, y = make_classification(random_state=0)
param_grid = {'max_depth': [1, 5]}
a = dcv.GridSearchCV(RandomForestClassifier(), param_grid, refit=False,
scoring={'score1': 'accuracy', 'score2': 'accuracy'})
b = GridSearchCV(RandomForestClassifier(), param_grid, refit=False,
scoring={'score1': 'accuracy', 'score2': 'accuracy'})
assert hasattr(a, 'best_index_') is hasattr(b, 'best_index_')
assert hasattr(a, 'best_estimator_') is hasattr(b, 'best_estimator_')
assert hasattr(a, 'best_score_') is hasattr(b, 'best_score_')
评论列表
文章目录