AttributeError : ‘GridSearchCV‘ object has no attribute ‘grid_scores_‘

原因在于grid_scores_在sklearn0.20版本中已被删除,取而代之的是cv_results_。

方法1(0.20版本已删除):
     grid_search.grid_scores_
方式2(0.20版本适用的方式):
     means = grid_search.cv_results_['mean_test_score']
     params = grid_search.cv_results_['params']

参考资料:AttributeError : 'GridSearchCV' object has no attribute 'grid_scores_'_不服输的南瓜的博客-CSDN博客

猜你喜欢

转载自blog.csdn.net/weixin_48419914/article/details/121953061