CLASSICAL ML · INTERVIEW QUESTION
What is the ROC curve and AUC? What are their limitations?
🟡 intermediate · Supervised Learning
Hint: True positive rate vs false positive rate at different thresholds.
Answer
ROC curve plots TPR (recall) vs FPR (1-specificity) at all classification thresholds. AUC (Area Under Curve): probability that a randomly chosen positive ranks higher than a randomly chosen negative. AUC = 0.5 (random), 1.0 (perfect).
Benefits: threshold-independent, scale-invariant, works well for balanced data.
Limitations:
- Misleading for imbalanced data (high AUC despite poor performance on minority class)
- Averages over all thresholds, many of which are irrelevant
- Doesn't account for calibration.
For imbalanced data: use Precision-Recall curve and AUPRC instead — focuses on the positive class. Calibration: even with good AUC, predicted probabilities may not match true frequencies.
Use calibration curves (reliability diagrams) and Brier score to assess.
Related questions
- What is overfitting? How do you detect and prevent it?
- What is cross-validation? Compare k-fold, stratified, and time series CV.
- Explain precision, recall, F1-score, and when to use each.
- How do you handle class imbalance? Compare different approaches.
- Explain bias-variance tradeoff with a concrete example.