Work out resampling requirement instantly with clear inputs, formula shown and shareable results.
To reach a target minority share t, the minority class must hold t/(1-t) times as many rows as the majority class. Oversampling adds that shortfall; undersampling instead deletes majority rows until the same ratio holds. Oversampling keeps all information but risks overfitting duplicated points, while undersampling throws away real data — the choice depends on how much majority data you can afford to lose.
Balance targets
required minority = t x majority / (1 - t); rows to add = required - current; majority to keep = minority x (1 - t) / t
Rarely. Full balancing distorts the base rate so predicted probabilities need recalibration. A 20 to 40 percent minority share usually captures most of the benefit.
When the model supports it. Class weights change the loss without duplicating or discarding rows, so training stays fast and probabilities stay closer to calibrated.