sklearn.grid_search.GridSearchCV()
使用on a执行网格搜索linear_model.Ridge
以找到合适的alpha
后,我们可以使用 获取网格分数clf.grid_scores_
。
结果中的数字是什么意思?这些数字如何告诉我们哪个是最好的alhpa
?这是一个grid_scores_
结果示例:
[({'alpha': 10.0},
-3.5395266121766391e-06,
array([ -5.81901982e-06, -5.27253774e-08, -4.74683464e-06])),
({'alpha': 5.0},
-3.5395266121766391e-06,
array([ -5.81901982e-06, -5.27253774e-08, -4.74683464e-06])),
({'alpha': 1.0},
-3.5395266121766391e-06,
array([ -5.81901982e-06, -5.27253774e-08, -4.74683464e-06])),
({'alpha': 0.5},
-3.5395266121766391e-06,
array([ -5.81901982e-06, -5.27253774e-08, -4.74683464e-06])),
({'alpha': 0.1},
-3.5395266121766391e-06,
array([ -5.81901982e-06, -5.27253774e-08, -4.74683464e-06])),
({'alpha': 0.05},
-3.5395266121766391e-06,
array([ -5.81901982e-06, -5.27253774e-08, -4.74683464e-06])),
({'alpha': 0.01},
0.00019276539505293697,
array([ 5.83095745e-04, -5.27253774e-08, -4.74683464e-06])),
({'alpha': 0.005},
0.072428630958501342,
array([ 0.07335483, 0.07190767, 0.07202339])),
({'alpha': 0.001},
0.37063142154124262,
array([ 0.37106198, 0.36953822, 0.37129406])),
({'alpha': 0.0005},
0.47042710942522803,
array([ 0.47063049, 0.4686987 , 0.47195214])),
({'alpha': 0.0001},
0.61100922361083054,
array([ 0.61189728, 0.60846248, 0.61266791]))]