0

I want to calculate AUC for (y_test, y_pred) for a RandomForest model with the code below. But there are some errors. It says ValueError: multiclass format is not supported. Looks like this:Error details . How can I fix it, guys? Thanks a lot!

from sklearn.metrics import roc_curve, auc
false_positive_rate, true_positive_rate, thresholds = roc_curve(y_test, y_pred)
roc_auc = auc(false_positive_rate, true_positive_rate)
roc_auc
AlexDong
  • 15
  • 1
  • are your predictions binary, i,e there are 2 only values of y_test? if not, the [implementation](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html) is restricted to binary only. – Deepansh Parmani Aug 17 '21 at 14:52
  • Hi, please read this https://stackoverflow.com/help/minimal-reproducible-example and this https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples to improve your question. – Be Chiller Too Aug 17 '21 at 15:22

0 Answers0