Fundamentals of AI and ML
Class Imbalance
Class imbalance matters when one outcome is much rarer than another, such as fraud or defects. Accuracy alone can look high even when the model misses the minority class.
Concepts
- Class imbalance occurs when one class is much more frequent than another, such as rare fraud events.
- Accuracy can be misleading on imbalanced data because predicting the majority class may score highly.
- Precision, recall, F1, AUC-ROC, class weighting, oversampling, and undersampling are common tools.
Exam tips
- Precision, recall, F1, and AUC-ROC are more informative than accuracy for many imbalanced classification tasks.
- Recall is important when missing positives is costly.
- Class weighting, oversampling, and undersampling are common mitigation strategies.