Learning path

Full curriculum

Full curriculum

Unit content

ROC and precision-recall curves

Many classifiers produce a score or probability rather than an unavoidable yes/no answer. A decision threshold converts that score into a class prediction, and changing the threshold changes the tradeoff between false positives and false negatives.

A ROC curve plots true-positive rate against false-positive rate as the threshold varies. Its area, ROC AUC, measures ranking quality: it equals the probability that a randomly chosen positive receives a higher score than a randomly chosen negative, with tied scores conventionally receiving half credit.

A precision-recall curve instead plots precision against recall. It is often more informative when the positive class is rare because it focuses directly on the quality and coverage of positive predictions.

For example, lowering a fraud-detection threshold usually catches more fraudulent transactions, increasing recall, but also flags more legitimate transactions, lowering precision.

A single threshold-dependent metric cannot describe this whole tradeoff. Curves reveal how the classifier ranks examples across many operating points, after which a threshold can be chosen according to the costs and constraints of the application.