问题描述
from sklearn.model_selection import gridsearchcv
from sklearn.linear_model import SGDClassifier
params = {'alpha': [0.001,0.01,0.1,1,10,100,1000],'penalty': ['l1','l2']}
lgrg = SGDClassifier(class_weight='balanced',loss='log')
clf =
gridsearchcv(estimator=lgrg,param_grid=params,scoring=recall_score,cv=5,return_train_score=True)
clf.fit(train_x,train_y)
y_pred = clf.predict(x_test)
print(pd.DataFrame(clf.cv_results_))
如果我打印,我会得到 nan 值
cv_results output in the form of dataframe
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)