Two rates 0 0.25 0.50 0.75 1 0 0.25 0.50 0.75 1 false positive rate true positive rate coin flip
The horizontal axis is the false positive rate: of the days that did not sell out, how many were called sold out. The vertical axis is the true positive rate, that is recall. The dashed diagonal is where a coin-flipping model sits.
One threshold, one point 0 0.25 0.50 0.75 1 0 0.25 0.50 0.75 1 false positive rate true positive rate threshold 0.50 coin flip
At threshold 0.50 the false positive rate is 0.13 and the true positive rate 0.88. These two numbers from the confusion matrix are a single point in the ROC plane.
Every threshold 0 0.25 0.50 0.75 1 0 0.25 0.50 0.75 1 false positive rate true positive rate threshold 0.50 coin flip
As the threshold falls from highest to lowest, the point walks from (0, 0) to (1, 1). This path is the ROC curve. The higher the curve sits above the diagonal, the better the model separates the classes.
The perfect corner 0 0.25 0.50 0.75 1 0 0.25 0.50 0.75 1 false positive rate true positive rate threshold 0.50 perfect coin flip
The top left corner, (0, 1), is where a perfect model sits: no false alarms, every sold-out day caught. Drag the yellow dot along the curve and try to find the threshold closest to this corner.
The area under the curve 0 0.25 0.50 0.75 1 0 0.25 0.50 0.75 1 false positive rate true positive rate threshold 0.50 perfect coin flip
AUC = 0.95. If one sold-out day and one other day are picked at random, this is the chance that the model gives the sold-out day the higher probability. 1 is perfect, 0.5 is a coin flip.
Choosing a threshold 0 0.25 0.50 0.75 1 0 0.25 0.50 0.75 1 false positive rate true positive rate threshold 0.50 perfect coin flip
The ROC curve shows every threshold at once; which one to pick depends on the cost of the errors. If false negatives are costly, go right, toward high recall; if false positives are costly, go left, toward few false alarms.
Why it matters 0 0.25 0.50 0.75 1 0 0.25 0.50 0.75 1 false positive rate true positive rate threshold 0.50 perfect coin flip
AUC is the most common way to compare models even when classes are unbalanced; it is reported for medical tests, credit risk and fraud detection. It leaves the choice of threshold for later.