[scikit-learn] question using GridSearchCV

Glenn Schultz glennmschultz at me.com
Wed Jul 24 15:11:15 EDT 2019


Thank you for answering ... makes sense now that you point it out.

Sent from my iPhone


> On Jul 24, 2019, at 2:57 PM, Andreas Mueller <t3kcit at gmail.com> wrote:
> 
> scoring is not a parameter.
> It needs to be passed to GridSearchCV
> 
> selfCLF =GridSearchCV(GradientBoostingClassifier(), parameters, versose = 3m n_jobs = 4), scoring='roc_auc')
> 
> 
> 
>> On 7/24/19 1:24 PM, Glenn Schultz via scikit-learn wrote:
>> 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)
>> _______________________________________________
>> scikit-learn mailing list
>> scikit-learn at python.org
>> https://mail.python.org/mailman/listinfo/scikit-learn
> 
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn



More information about the scikit-learn mailing list