Why when I use GridSearchCV with roc_auc scoring, the score is different for grid_search.score(X,y) and roc_auc_score(y, y_predict)?
问题 I am using stratified 10-fold cross validation to find model that predicts y (binary outcome) from X (X has 34 labels) with the highest auc. I set the GridSearchCV: log_reg = LogisticRegression() parameter_grid = {'penalty' : ["l1", "l2"],'C': np.arange(0.1, 3, 0.1),} cross_validation = StratifiedKFold(n_splits=10,shuffle=True,random_state=100) grid_search = GridSearchCV(log_reg, param_grid = parameter_grid,scoring='roc_auc', cv = cross_validation) And then do the cross-validation: grid