我想通过交叉验证返回逻辑回归的系数。
from sklearn.model_selection import cross_val_score
from sklearn.preprocessing import StandardScaler
X_train,X_test,y_train,y_test=train_test_split(StandardScaler().fit_transform(X),y,test_size=0.3,random_state=0)
model = LogisticRegression(class_weight= 'balanced')
print(cross_val_score(model, X, y, cv=5, scoring='roc_auc').mean())
当我这样做
Coefficients = model.coef_
它会产生错误** AttributeError:'LogisticRegression'对象没有属性'coef _'**