为什么即使我尝试了从 0.01 到 25 的一长串 alpha,我的交叉验证岭回归模型中的错误也没有显着变化?
代码
from sklearn.linear_model import Ridge
from sklearn.model_selection import GridSearchCV
params={'alpha': [25,10,4,2,1.0,0.8,0.5,0.3,0.2,0.1,0.05,0.02,0.01]}
rdg_reg = Ridge()
clf = GridSearchCV(rdg_reg,params,cv=2,verbose = 1, scoring = 'neg_mean_squared_error')
clf.fit(x_dummied_poly,y)
clf.best_params_
#{'alpha': 4}
pd.DataFrame(clf.cv_results_)