Fraud detection is the textbook case. If one transaction in 1,000 is fraud, a model that always answers “not fraud” is 99.9% accurate and completely useless. The same pattern shows up in rare-disease screening, equipment-failure prediction, security alerts and content moderation: the cases a business cares about most are the ones it has fewest examples of.
Two problems follow. During training, the model sees so few rare examples that it barely learns them. During evaluation, accuracy hides the failure. Better yardsticks are precision and recall, the F1 score, or a confusion matrix that shows the rare-class errors directly.
Fixes come in three families. Resample the training set: downsample the common class, or oversample the rare class (SMOTE creates synthetic rare examples). Reweight the loss so mistakes on the rare class cost more. Or move the decision threshold so the model flags more borderline cases, trading more false positives for fewer misses. Keep the test set at the real-world ratio, though, or the scores won’t reflect production. When the rare class is too rare to label at all, the problem often turns into anomaly detection.
Sources
- Google Machine Learning Crash Course: Imbalanced datasets — Explains majority and minority classes, why batches may contain too few minority examples, and downsampling plus upweighting the majority class; checked October 24, 2026.
- Google Machine Learning Glossary: class-imbalanced dataset — Defines a class-imbalanced dataset as one where the number of labels in each class differs significantly; checked October 24, 2026.
- imbalanced-learn: User guide — Documents over-sampling (including SMOTE), under-sampling and combined methods for rebalancing training data; checked October 24, 2026.