How does SMOTE generate new synthetic data points?

Last updated 15 November 2026

SMOTE creates synthetic minority points by interpolating between a minority sample and one of its nearest minority-class neighbors, placing a new point at a random position on the line segment between them.

  • Algorithm:

    1. For a minority sample x, find its k nearest minority neighbors (default k_neighbors=5).

    2. Pick one neighbor x_nn at random.

    3. Draw λ ~ Uniform(0, 1) and create x_new = x + λ · (x_nn − x).

    4. Repeat across minority samples until the target ratio is reached.

  • Why it helps: The new points are not exact copies, so the minority region widens and the model is less likely to memorize individual rows than with random duplication.

  • Key properties and caveats:

    • Only minority points are used, so majority-class positions are ignored and synthetics can land in overlap zones.

    • It relies on distances, so features need scaling, and it only makes sense for continuous features (use SMOTE-NC or SMOTEN for categorical ones).

    • Apply it only to training folds (inside an imblearn Pipeline), never before the train/test split.

[lang:python] from imblearn.over_sampling import SMOTE X_res, y_res = SMOTE(k_neighbors=5, random_state=0).fit_resample(X_train, y_train)

  • https://www.geeksforgeeks.org/machine-learning/smote-for-imbalanced-classification-with-python/
  • https://www.lyzr.ai/glossaries/smote/
  • https://imbalanced-learn.org/stable/references/generated/imblearn.over_sampling.SMOTE.html
All Imbalanced Datasets interview questions