SMOTE, the synthetic minority oversampling technique, is a resampling method in machine learning that balances a skewed training set by generating new minority-class examples through interpolation between existing neighbors in feature space. Instead of copying rare records, it places artificial points on the line segments that connect each minority sample to one of its nearest minority neighbors.
Within artificial intelligence practice, SMOTE is one of the most widely used responses to class imbalance, the situation in which one class (fraud, failure, disease) is far rarer than the others. It is applied only to training data, and its value depends heavily on the classifier, the evaluation metric and the geometry of the data.
How SMOTE generates synthetic samples
SMOTE creates each synthetic record by choosing a minority sample, picking one of its k nearest minority neighbors and interpolating at a random point between them. Formally, the new point is x_new = x_i + λ (x_nn – x_i), where λ is drawn uniformly from 0 to 1. The result lies on the segment between two real minority observations.
The neighbor search uses the k-nearest neighbors procedure, usually with Euclidean distance and a default of k = 5. Because distance drives the whole process, feature scaling must be applied first; otherwise a feature measured in thousands dominates one measured in fractions, and the neighbors become meaningless.
The algorithm repeats these steps until the minority class reaches a target size, which is set by a sampling ratio rather than by a fixed count. The following table lists the parameters that control this process.
| Parameter | Typical value | What it controls |
|---|---|---|
| Number of neighbors (k) | 3 to 7, default 5 | How local the interpolation is |
| Sampling ratio | 0.1 to 1.0 of majority size | How many synthetic points are created |
| Distance metric | Euclidean | Which samples count as neighbors |
| Random seed | Any fixed integer | Reproducibility of generated points |
Why oversampling helps imbalanced classifiers
SMOTE helps because many learners minimize overall error, and with a 1:100 ratio a model can reach 99 percent accuracy by ignoring the minority class entirely. Adding synthetic minority points shifts the decision boundary away from the rare class and gives the learner more varied regions to cover.
Compared with random oversampling, which duplicates existing rows, SMOTE produces new values and therefore reduces exact-copy overfitting. A decision tree trained on duplicates tends to carve tiny regions around each repeated point, whereas interpolated points encourage broader, smoother minority regions.
SMOTE variants and when each applies
Several SMOTE variants exist because the original method treats all minority samples equally, including noisy ones and those deep inside the minority cluster. The table below summarizes the most common variants.
| Variant | Key idea | Best suited for |
|---|---|---|
| Borderline-SMOTE | Oversamples only minority points near the boundary | Classes that overlap at the margin |
| ADASYN | Generates more points where minority is hardest to learn | Uneven minority density |
| SMOTE-NC | Handles mixed numeric and categorical features | Tabular data with categories |
| SVM-SMOTE | Uses support vectors to locate the boundary | Data where support vector machines work well |
| SMOTE-Tomek and SMOTE-ENN | Oversample, then remove ambiguous pairs | Noisy data with class overlap |
Plain SMOTE assumes continuous numeric features. Applying it after one-hot encoding yields fractional category values such as 0.37, which correspond to no real category; SMOTE-NC or SMOTEN avoid this by assigning the most frequent neighbor category instead.
How SMOTE compares with other imbalance strategies
SMOTE is one option among several for class imbalance, and it is often not the strongest one for modern ensemble models. Class weighting, threshold tuning and undersampling address the same problem without inventing data.
| Strategy | Mechanism | Main drawback |
|---|---|---|
| SMOTE | Synthesizes minority points | Can create unrealistic samples |
| Random oversampling | Duplicates minority rows | Overfitting to repeated points |
| Random undersampling | Removes majority rows | Discards useful information |
| Class weights | Raises the loss for minority errors | Needs a weighted learner |
| Threshold tuning | Moves the decision cutoff | Requires calibrated probabilities |
With gradient boosting and random forest models, empirical comparisons frequently find that class weights plus threshold tuning match or beat SMOTE, while avoiding its extra preprocessing step. SMOTE tends to add more value for weak or distance-based learners such as logistic regression and k-nearest neighbors.
Applying SMOTE correctly in a pipeline
The single most important rule is to apply SMOTE only inside the training fold. Oversampling before the train-test split or before cross-validation leaks information, because synthetic points built from test records end up in training, and reported scores become optimistically biased.
- Split the data first, then fit scaling and SMOTE on training folds only.
- Use a pipeline object that resamples during fitting but never during prediction.
- Evaluate with precision, recall, F1 and the precision-recall curve, not accuracy.
- Tune k and the sampling ratio together with model hyperparameter tuning.
The decision table below helps choose whether SMOTE is a reasonable first step for a given situation.
| Situation | Recommended choice | Reason |
|---|---|---|
| Numeric features, simple model | Try SMOTE | Fills sparse minority regions |
| Tree ensemble, large data | Class weights first | Cheaper and often as effective |
| Mostly categorical features | SMOTE-NC or SMOTEN | Avoids invalid category values |
| Very high-dimensional data | Avoid plain SMOTE | Neighbors lose meaning |
| Fewer than about 10 minority samples | Collect more data | Too few seeds to interpolate |
Limitations and common mistakes with SMOTE
SMOTE has well-known limitations that experienced practitioners check for before trusting results. Its interpolation assumes that the space between two minority points is also minority territory, which fails when the minority class is split into separate clusters with majority samples between them.
- Noise amplification: a mislabeled minority point seeds further wrong samples.
- Class overlap: synthetic points can land inside majority regions and blur the boundary.
- Curse of dimensionality: in hundreds of dimensions, nearest neighbors are nearly equidistant.
- Probability miscalibration: models trained on balanced data overestimate minority probability in production.
- Not suitable for raw images or text, where linear interpolation rarely yields realistic inputs.
Because the training prior changes, predicted probabilities must be recalibrated or the threshold adjusted when the model faces the true class ratio. SMOTE also does nothing about concept drift, so a rebalanced model still needs monitoring after deployment.
A non-technical view
Imagine teaching someone to spot counterfeit banknotes when the practice pile contains a thousand real notes and only ten fakes. The learner may simply decide that every note is real, because that guess is almost always right. SMOTE fixes the lopsided practice pile by inventing new fake examples.
It does this carefully: it takes two similar fakes and creates a new one that sits somewhere between them, a blend of their features. The new examples are plausible, not copies, so the learner sees more variety. The catch is that blending only works when the in-between examples are realistic, and the invented examples must never be used to grade the learner.
A concrete example
A data team at a regional bank builds a model to flag fraudulent card transactions. Its training set contains 200,000 transactions, of which only 400 are fraudulent, a ratio of 1:500. A logistic regression trained on the raw data reaches 99.8 percent accuracy but catches only 22 percent of fraud cases.
The team standardizes the 30 numeric features, then applies SMOTE with k = 5 inside each cross-validation fold, raising the fraud class to 20 percent of the training fold. Evaluated on an untouched test set with the real 1:500 ratio, recall rises to about 70 percent while precision drops to an acceptable level for manual review. The team also recalibrates probabilities and compares the result against class weighting, which performs similarly; they keep SMOTE because it gave the most stable recall across folds.