Day60 param_grid的命名問題
2019/08/30 下午 05:27
機器學習共學討論版
李慧君
觀看數:27
回答數:2
收藏數:0
gridsearchcv
ml100-2-d60
ml100-2
圖為Day60的範例,請問param_grid這個字典的key命名方式是不是有一定的規則?
回答列表
-
2019/09/02 下午 03:45張維元 (WeiYuan)贊同數:0不贊同數:0留言數:1
嗨,我只看到這個例子,不過沒有找到完整的說明 QQ
給你參考:https://machine-learning-python.kspax.io/general_examplesmd/ex2_feature_stacker#san-featureunionc
__ 兩個底線應該是去找前面使用到的 function
_ 表示要優化的參數範圍
-
2020/03/24 下午 02:21郭浩傑贊同數:0不贊同數:0留言數:0
sklearn 官網有提到:
The purpose of the pipeline is to assemble several steps that can be cross-validated together while setting different parameters. For this, it enables setting parameters of the various steps using their names and the parameter name separated by a ‘__’.....(略)
所以規則大概是
{modelName__parameterName : [0, 1, 2, 3, 4, 5]}
請參考:https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html