roc_auc score GridSearch
-
16-10-2019 - |
Question
I am experimenting with xgboost.
I ran GridSearchCV with score='roc_auc' on xgboost. The best classificator scored ~0.935 (this is what I read from GS output). But now when I run best classificator on the same data:
roc_auc_score(Y, clf_best_xgb.predict(X))
it gives me score ~0.878
Could you tell me how the score is evaluated in both cases? Thanks
Solution
Try using predict_proba instead of predict as below. It should give you the same number.
roc_auc_score(Y, clf_best_xgb.predict_proba(X)[:,1])
When we compute AUC, most of time people will use the probability instead of the actual classs.
Licensed under: CC-BY-SA with attribution
Not affiliated with datascience.stackexchange