[scikit-learn] question using GridSearchCV

Glenn Schultz glennmschultz at me.com
Wed Jul 24 14:24:36 EDT 2019


I am using GBClassifier, the below works if I use the default accuracy but it fails using roc_auc or roc_auc_score.  I have found many examples to work with but for the life of me I can’t get it two work with roc_auc.  What am I doing wrong.

from sklearn.ensemble import GradientBoostingClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import auction, roc_auc_score 

y_train = LoansTrainData[‘event’]
x_train LoanTrainData[LoansTrainData.columns.drop(‘event’)]

parameters = {“loss” :[‘deviance’],
			“scoring” :[‘roc_auc’},
			“learning_rate” :[.1, .05]

selfCLF =GridSearchCV(GradientBoostingClassifier(), parameters, versose = 3m n_jobs = 4)
searchCLF(x_train, y_train)


More information about the scikit-learn mailing list