Confusion Matrix and ROC Curves
Confusion Matrix and ROC Curves
Let's explore two powerful tools for understanding classification model performance.
Reading a Confusion Matrix
Loading Python Playground...
Adjusting the Threshold
Loading Python Playground...
ROC Curve Intuition
Loading Python Playground...
AUC: Area Under the Curve
Loading Python Playground...
Multi-class Confusion Matrix
Loading Python Playground...
Key Takeaways
- Confusion matrix shows all 4 outcomes: TP, TN, FP, FN
- Threshold trades off precision vs recall
- ROC curve shows TPR vs FPR at all thresholds
- AUC summarizes ROC in a single number (0.5 = random, 1.0 = perfect)
- For multi-class: calculate metrics per class or use macro/micro averaging
- Use sklearn:
confusion_matrix(),roc_curve(),roc_auc_score()
Quiz
Question 1 of 520% Complete
0 of 5 questions answered

