Scikit-Learn:GridSearchCV为线性回归提供相同的结果

时间:2017-03-12 15:00:45

标签: python scikit-learn linear-regression grid-search

我在Boston dataset

上尝试了GridSearchCV和线性回归
from sklearn.model_selection import GridSearchCV
parameters = {'fit_intercept':('True', 'False'), 'normalize':('True', 'False'), 'copy_X':('True', 'False')}
clf3 = GridSearchCV(reg, parameters)
clf3.fit(X, y)

我得到所有参数排列的相同值:

clf3.grid_scores_
[mean: -1.57573, std: 3.02988, params: {'normalize': 'True', 'copy_X': 'True', 'fit_intercept': 'True'},
 mean: -1.57573, std: 3.02988, params: {'normalize': 'False', 'copy_X': 'True', 'fit_intercept': 'True'},
 mean: -1.57573, std: 3.02988, params: {'normalize': 'True', 'copy_X': 'True', 'fit_intercept': 'False'},
 mean: -1.57573, std: 3.02988, params: {'normalize': 'False', 'copy_X': 'True', 'fit_intercept': 'False'},
 mean: -1.57573, std: 3.02988, params: {'normalize': 'True', 'copy_X': 'False', 'fit_intercept': 'True'},
 mean: -1.57573, std: 3.02988, params: {'normalize': 'False', 'copy_X': 'False', 'fit_intercept': 'True'},
 mean: -1.57573, std: 3.02988, params: {'normalize': 'True', 'copy_X': 'False', 'fit_intercept': 'False'},
 mean: -1.57573, std: 3.02988, params: {'normalize': 'False', 'copy_X': 'False', 'fit_intercept': 'False'}]

谁能告诉我我做错了什么?

TIA

0 个答案:

没有答案