我正在尝试将SMOTE和GridSearchCV结合在一起。我正在将Startified K-fold对象与名为 my_pipe 的管道一起使用。该管道旨在:
skf = StratifiedKFold(n_splits=4, shuffle = True, random_state = 45)
my_pipe=Pipeline([('minmaxscaler', MinMaxScaler()),('smote',SMOTE()),('logisticregression',LogisticRegression())])
params = {"C":np.logspace(-3,3,7), "penalty":["l1","l2"]}
my_grid={'logisticregression__' + key: params[key] for key in params}
之后是如下的拟合方法
logistic_clf = GridSearchCV(my_pipe, param_grid = my_grid, cv = skf, scoring='roc_auc',verbose = 0,n_jobs=10,return_train_score=False)
logistic_clf.fit(X_train, y_train)
虽然代码可以正常运行而没有任何错误消息,但我有以下问题。