Oversampling Results
Exports and Generated Code
Run the calculator to generate reproducible implementation code.
Formula Used
SMOTE creates a sample between a minority observation and one neighbor. It uses a random interpolation coefficient. The new point remains within their feature segment.
ADASYN allocates more samples to difficult minority regions. Borderline methods emphasize observations near competing classes. Random oversampling duplicates existing minority observations with optional jitter.
How to Use
- Paste or upload a labeled dataset.
- Parse it and confirm target, feature, and categorical columns.
- Select an oversampling method and target strategy.
- Choose preprocessing, validation, and algorithm parameters.
- Generate samples, inspect warnings, and export results.
Example Data
| age | income | tenure | region | label |
|---|---|---|---|---|
| 25 | 42000 | 1 | North | No |
| 30 | 54000 | 3 | East | Yes |
Frequently Asked Questions
What is synthetic oversampling?
It creates new minority observations instead of only duplicating rows. Generated values follow patterns between nearby minority samples. This can improve model learning on rare classes.
When should SMOTE be used?
Use SMOTE for imbalanced classification with meaningful numeric neighborhoods. Apply it only within training data. Validate results using class-sensitive evaluation metrics.
What does SMOTE-NC handle?
SMOTE-NC supports mixtures of numerical and categorical features. Numeric values are interpolated between neighbors. Categories are selected from nearby minority observations.
Why can oversampling cause leakage?
Leakage occurs when synthetic data uses validation observations. Split data before creating synthetic samples. Pipeline-based resampling prevents this common evaluation error.
How should neighbor count be chosen?
Small minority classes require a low neighbor count. Larger values smooth the generated distribution. Cross-validation helps compare reasonable settings safely.
What is ADASYN best for?
ADASYN emphasizes minority points surrounded by competing classes. It focuses generation on difficult regions. This can also amplify noisy observations.
Which metrics suit imbalanced data?
Prefer recall, F1, balanced accuracy, G-mean, and PR-AUC. Accuracy alone can hide minority failures. Compare several metrics across validation folds.
Can multiclass data be oversampled?
Yes, each eligible class can receive a separate target. The calculator supports per-class mappings. Review class overlap after generating samples.
Should test data be balanced?
Usually test data should preserve its natural distribution. Oversampling is intended for model training. Realistic testing gives more trustworthy performance estimates.