ROC curve, precision and recall, explained interactively
Slide a classifier's threshold and watch precision, recall and the ROC curve respond, then see why accuracy can tell you nothing.
A classifier usually gives a score, and you choose the threshold that turns the score into a yes or a no. That choice is a trade-off, and accuracy alone hides it. The numbers below are computed from the simulated scores you see, and the example is predicting which customers will leave.
What the numbers mean
- Precision: of the customers you flagged, the share who really left.
- Recall: of the customers who really left, the share you flagged.
- F1: a single score that's high only when both are.
Lowering the threshold catches more real cases and raises more false alarms. Which matters more depends on what each mistake costs.
The ROC curve
Instead of judging one threshold, the ROC curve plots every threshold at once: the share of real cases caught against the share of false alarms. AUC is the area under that curve, which is also the chance the model scores a random positive above a random negative. 1.0 is perfect, and 0.5 is no better than chance.
Learn how this works, properly
A free account opens all 244 lessons, with Python that runs in your browser, saved progress and certificates.