Resampling and Class Weights
Rebalance with code, not more data.
Two Ways to Rebalance
You can fix skew by changing the data with resampling, or by changing the math with class weights. Both nudge attention to the rare class.
Oversampling the Minority
Oversampling copies or synthesizes more rare examples so the classes meet in the middle, giving the model more to learn from.
All lessons in this course
- Why Rare Classes Get Ignored
- Resampling and Class Weights
- Choosing Threshold and Metric
- End-to-End Imbalanced Pipeline