0
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 以数据帧的形式输出

4

0 回答 0