ROS, RUS and SMOTE before and after
Compare random over- and under-sampling and SMOTE, and see the synthetic points.
العربيةThe idea
The method is applied to training data only and evaluated on an untouched test set.
Data description
Synthetic data generated in your browser from stated distributions; no real personal data.
Suggested next experiment
Concepts in this experiment
SMOTE synthesis formula
x_nn is one of x_i's k nearest same-class neighbours.
x_{\text{new}}=x_i+\lambda\,(x_{nn}-x_i),\quad \lambda\sim U(0,1)SMOTE (SMOTE)
Creates synthetic minority examples by interpolating between an example and one of its k nearest same-class neighbours (Chawla et al., 2002). Apply it to training data only, after the split and inside each CV fold; applying it before the split leaks test information.
Random over/under-sampling (زيادة العينات وتقليلها عشوائياً)
ROS duplicates minority examples; RUS removes majority examples. ROS can overfit; RUS loses information.
Scientific sources for this experiment
- SMOTE: Synthetic Minority Over-sampling Technique (arXiv:1106.1813)N. V. Chawla, K. W. Bowyer, L. O. Hall, W. P. Kegelmeyer (2002) — Paper
- imbalanced-learn — SMOTEimbalanced-learn developers (2025) — Tool
