Oversampling Ratio Calculator
Calculate the target minority-class size after oversampling (e.g. SMOTE) to reach a desired class ratio.
Inputs
e.g. 1 = fully balanced (1:1); 2 = majority is 2x minority after resampling.
New Minority Class Size
4,750
Synthetic Samples Needed
4,250
Current Imbalance Ratio
19.00:1
Step by step
Current ratio
9500 ÷ 500
= 19.00 : 1
New minority class size
9500 ÷ 2
= 4750
Synthetic samples to generate
4750 − 500
= 4250
How it works
Oversampling techniques like SMOTE generate synthetic minority-class samples to shrink the imbalance ratio toward a target value, without touching the majority class. This calculator computes the required new minority class size (majority ÷ target ratio) and the number of synthetic samples needed to reach it — the gap between the new target size and your current minority count.
Formulas
New minority size
new_minority = round(majority_count / target_ratio)
- majority_count
- Number of majority-class samples
- target_ratio
- Desired majority:minority ratio (e.g. 2 for 2:1)
Synthetic samples needed
synthetic_needed = new_minority - current_minority
- new_minority
- Target minority class size
- current_minority
- Current minority class size
Frequently Asked Questions
Should I always aim for a 1:1 ratio?
Not necessarily — a moderate target ratio (e.g. 2:1 or 3:1) often generalizes better than forcing perfect balance, since heavy oversampling risks overfitting to synthetic minority patterns.
Does SMOTE just duplicate minority samples?
No — SMOTE generates new synthetic samples by interpolating between existing minority-class neighbors in feature space, rather than simple duplication, which tends to generalize better.
Should oversampling be applied before or after the train/test split?
Always oversample only the training set after splitting — oversampling before splitting leaks synthetic-derived information into the test set and inflates evaluation metrics.
You might also need
- Undersampling Ratio CalculatorCommonly used together
- Class Imbalance Ratio CalculatorCommonly used together
- Stratified Split CalculatorCommonly used together
- Random Seed GeneratorAlso in Miscellaneous AI
- Sequence Truncation CalculatorAlso in Miscellaneous AI
- Dataset Split CalculatorAlso in Miscellaneous AI