ROC Curve & AUC
Machine Learning · Intermediate
Definition
The ROC curve plots true-positive rate against false-positive rate across thresholds; AUC summarizes it.
Compares classifiers independent of a single threshold.
Diagram
Flowchart
Example: AUC by pair ranking
pos, neg = [0.9, 0.7], [0.6, 0.8]
wins = sum(p > n for p in pos for n in neg)
print(wins / (len(pos) * len(neg)))Output: 0.75
Key points
- AUC = probability a random positive ranks above a random negative
- Use PR curves for heavy imbalance
Interview questions
What does AUC 0.5 mean?
The model ranks no better than random guessing.