结果显示“ SelectKBest”对象没有属性“ predict”

时间:2019-10-22 00:02:08

标签: python scikit-learn model

model = SelectKBest(chi2)
n_components = [3,4,5,6,7,8]
param_grid = dict(k=n_components)
grid_search = GridSearchCV(model,param_grid,scoring = 'accuracy')
m1 = grid_search.fit(x_train, y_train)
print(" Best_score: %.4lf" %grid_search.best_score_)
print(" Best_params:", grid_search.best_params_)

0 个答案:

没有答案