Skip to content

ROC AUC Measures How Well a Classifier Ranks Positives

ROC AUC is the area under a classifier's ROC curve, and it equals the probability that the classifier gives a randomly chosen positive example a higher score than a randomly chosen negative one. Tom Fawcett's introduction to ROC analysis states this as an important statistical property of the AUC. His introduction also gives the scale: the AUC is always between 0 and 1.0, random guessing draws the diagonal with an area of 0.5, and so, in his words, no realistic classifier should have an AUC below 0.5. That "should" is a practical expectation and not a mathematical bound: a classifier whose scores point the wrong way scores below 0.5, as the sign flip below shows.

Try it by hand. Three positive examples get scores 0.9, 0.6, and 0.4. Three negative examples get 0.8, 0.5, and 0.2. There are 3 × 3 = 9 positive-negative pairs. Count the pairs where the positive scores higher. The 0.9 beats all three negatives: 3 pairs. The 0.6 beats 0.5 and 0.2 but loses to 0.8: 2 pairs. The 0.4 beats only 0.2: 1 pair. That is 6 of 9, so AUC = 6/9 = 0.667. Now draw the ROC curve by sweeping a threshold from the top score down. Its points are (0, 0), (0, ⅓), (⅓, ⅓), (⅓, ⅔), (⅔, ⅔), (⅔, 1), and (1, 1), and the trapezoid area under them is also 6/9. The pair count and the area agree. (If a positive and a negative tie on a score, the usual convention gives that pair half credit. Change the negative scored 0.5 to 0.6, tying with the positive at 0.6, and the pair count becomes 5.5 of 9, an AUC of 0.611, matching the trapezoid again.)

AUC reads only the ordering of the scores, so any strictly increasing transformation of them, such as multiplying by a positive number, cannot change it. Multiply all six scores above by 0.1, to 0.09, 0.06, 0.04 and 0.08, 0.05, 0.02, and every pair keeps its order: AUC is still 0.667. A decreasing change is different: multiply by −1 and every pair flips, so the AUC becomes 1 − 0.667 = 0.333. The unchanged AUC under positive rescaling does not establish that the scores are calibrated probabilities. Fawcett makes the same point: a classifier "need not produce accurate, calibrated probability estimates; it need only produce relative accurate scores that serve to discriminate positive and negative instances."

The trap: treating a high AUC as a guarantee of calibrated probabilities or of a good decision threshold. AUC says how well the scores rank positives above negatives. It says nothing about whether 0.8 means an 80 percent chance, or where to cut the scores to make decisions. Those need separate checks.

Prof Rod's rule: report AUC for ranking quality, a calibration check for the probabilities, and the cost-based threshold for the decision.

The scores are invented for the example.

Fawcett, "An introduction to ROC analysis," Pattern Recognition Letters 27 (2006) 861-874, Section 7 (AUC) and Section 4.1 (relative versus absolute scores)