I am using a classifier which returns probabilities. To calculate AUC, I am using pROC R-package. The output probabilities from classifier are:
probs=c(0.9865780,
0.9996340,
0.9516880,
0.9337157,
0.9778576,
0.8140116,
0.8971550,
0.8967585,
0.6322902,
0.7497237)
probs
shows probability of being in class '1'. As shown, the classifier has classified all of samples in class '1'.
True label vector is:
truel=c(1, 1, 1, 1, 1, 0, 0, 0, 0, 0)
As shown, classifier has misclassified 5 samples. But, AUC is:
pROC::auc(truel, probs)
Area under the curve: 1
Could you please explain to me why it happens?