1. Home
  2. Data Science
  3. Scikit-learn
  4. Why does roc_auc_score reject the hard 0/1 labels returned…

Added 30 Nov -0001

Why does roc_auc_score reject the hard 0/1 labels returned by predict?

  1. It accepts only predict_proba output and never a decision-function score at all
  2. It rejects them only when the test set's classes are imbalanced
  3. It needs continuous scores, because one threshold gives a single ROC point Correct answer
  4. It requires probability values that sum to one across both the classes

Correct answer

C. It needs continuous scores, because one threshold gives a single ROC point

18 views

MCQSEXAM

Explanation

roc_auc_score sweeps every threshold, so it needs a ranking score such as predict_proba or decision_function rather than the thresholded labels returned by predict. With hard labels there is only one operating point, and the AUC collapses to a value determined by accuracy alone. That is also why AUC is threshold-independent while accuracy is not.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Scikit-learn MCQs

Practise all Scikit-learn MCQs

Similar MCQs