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_

 

 

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2021-09-23
  • 2021-08-14
猜你喜欢
  • 2022-12-23
  • 2022-03-05
  • 2021-09-23
  • 2021-12-23
  • 2021-09-03
  • 2021-11-30
  • 2022-12-23
相关资源
相似解决方案