网格搜索

API:

  model = ms.GridSearchCV(模型,超参数组合列表,cv=折叠书)

        网格搜索

  model.fit(输入集,输出集)

  #获取网格搜索的每个参数集合

  model.cv_results_['params']

 

# 获取网格搜索每个参数组合
model.cv_results_['params']
# 获取网格搜索每个参数组合所对应的平均测试分值
model.cv_results_['mean_test_score']

for p,s in zip(model.cv_results_['params'],model.cv_results_['meantest_score']):
print(p,s)


# 获取最好的参数
model.best_params_
model.best_score_
model.best_estimator_

 

 

超参数组合列表:[{},{},{}]

posted @ 2020-03-24 10:54  初学者小明  阅读(744)  评论(0编辑  收藏  举报