Class Imbalance & Resampling
What is Class Imbalance?
When one class dominates
Moderately imbalanced — the minority class is under-represented and most classifiers will struggle.
Step 1 of 6: What is Class Imbalance?
When one class dominates
Moderately imbalanced — the minority class is under-represented and most classifiers will struggle.
Step 2 of 6: The Accuracy Paradox
99% accurate, 0% useful
A model that always predicts the majority class gets 95.0% accuracy but zero recall on the minority — it never catches fraud, disease, or rare events. Accuracy alone is misleading when classes are imbalanced.
Step 3 of 6: Random Oversampling
Duplicate the minority
No oversampling applied — the minority class remains under-represented.
Step 4 of 6: SMOTE
Synthetic minority samples
No synthetic points yet. Drag the slider to generate SMOTE samples between nearest-neighbor pairs.
Step 5 of 6: Class Weights
Penalize majority errors less
Equal weights — the decision boundary favors the majority class, missing many minority examples.
Step 6 of 6: Better Metrics
Beyond accuracy
Near-optimal threshold — best F1 of 59% balances precision and recall. This is the sweet spot.