I tried to create an ROC curve with sklearn, below is my code
from sklearn.metrics import roc_curve
fpr_keras, tpr_keras, thresholds_keras = roc_curve(validation_generator.classes, y_pred_label_indices)
when I print
print(fpr_keras):
[0. 0.48 0.568 0.584 0.632 0.648 0.664 0.68 0.992 0.992 1. 1. ]
print(tpr_keras)
[0. 0. 0. 0. 0. 0. 0. 0. 0. 0.016 0.016 1. ]
print(thresholds_keras)
[2.0000000e+00 1.0000000e+00 9.9999988e-01 9.9999976e-01 9.9999893e-01
9.9999881e-01 9.9999833e-01 9.9999821e-01 9.6940529e-01 6.8794215e-01
5.7934558e-01 1.9927023e-05]
but when I plotted it using this code :
plt.plot(fpr_keras, tpr_keras, thresholds_keras)
plt.plot([0,1], [0,1], 'r--')
plt.xlim([0, 1])
plt.ylim([0, 1])
I got this :
why is that?, is there something wrong with my code?