Course contentsShow
← Machine Learning and Deep Learning
Lesson 548 of 3,53813. Imbalanced and Multi-Label ProblemsFree lesson

Evaluation Metrics for Imbalanced Classification

Choose appropriate metrics: precision-recall curves, F1-score, balanced accuracy, and MCC for imbalanced evaluation.

Evaluation Metrics for Imbalanced Classification

What you'll learn: How to properly evaluate model performance when dealing with imbalanced datasets using metrics that reflect true predictive quality.

Why Standard Metrics Fail

When you've learned techniques like SMOTE, class weighting, and threshold adjustment to handle imbalance, you need metrics that actually measure what matters. Standard accuracy is misleading—a model predicting "not fraud" for all transactions might achieve 99% accuracy if fraud is only 1% of cases, yet catch zero fraudulent transactions.

The Right Metrics for Imbalanced Problems

Precision-Recall Curves show the trade-off between precision (quality of positive predictions) and recall (coverage of actual positives) across different thresholds. For imbalanced data, this is far more informative than ROC curves because it focuses on minority class performance.

F1-Score balances precision and recall through their harmonic mean. It's especially useful when you care equally about false positives and false negatives in the minority class.

Balanced Accuracy averages recall across both classes, preventing the majority class from dominating the metric. If you have 95% negatives and 5% positives, balanced accuracy gives equal weight to performance on each.

Matthews Correlation Coefficient (MCC) considers all four confusion matrix values (TP, TN, FP, FN) and produces a single score between -1 and +1. It's particularly robust to class imbalance and provides a balanced measure even when class distributions are severely skewed.

Choosing Your Metric

Consider domain costs: in medical diagnosis, missing a disease (low recall) might be catastrophic. In spam detection, false positives (low precision) annoy users. Combine domain knowledge with these metrics to guide model development.

Key Takeaway: For imbalanced classification, always evaluate with precision-recall curves, F1-score, balanced accuracy, or MCC—never rely on accuracy alone, as it masks poor minority class performance.