Intermediate · Data
Data Imbalance
Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.
TL;DR. When some classes or groups are vastly more frequent in the dataset than others.
Technical Definition
When some classes or groups are vastly more frequent in the dataset than others.
How it works
Imbalance — 99% non-fraud, 1% fraud — biases models toward the majority class and inflates accuracy metrics. Remedies include resampling (over/under), class weights in the loss, focal loss, and metric choices like F1 or AUC instead of accuracy.
Related Concepts
- Sampling (data) — Selecting a subset of records from a larger dataset for training, evaluation, or analysis.
- Accuracy — The fraction of predictions a model gets correct on a labeled dataset.
- F1 Score — The harmonic mean of precision and recall, balancing both into a single number.