🧪  SMOTE (Synthetic Minority Over-sampling Technique)

SMOTE (Synthetic Minority Over-sampling Technique)#

Creates new minority examples by interpolating between nearest neighbours instead of duplicating existing rows.

Important

✨ AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.

What it is#

SMOTE (Synthetic Minority Over-sampling Technique), introduced by Chawla and colleagues in 2002, fixes class imbalance by synthesising new minority-class examples rather than duplicating existing ones. Where plain duplication just copies points, SMOTE invents plausible new ones in the gaps between real minority samples.

Why not just duplicate#

Random oversampling repeats the same minority rows, so a classifier can memorise those exact points and overfit. SMOTE instead places new points along the lines between nearby minority samples, filling out the minority region and pushing the decision boundary toward something more general.

The algorithm#

For each minority sample \(x\):

  1. find its \(k\) nearest minority-class neighbours;

  2. pick one neighbour \(x_{nn}\) at random;

  3. create a synthetic point on the segment joining them,

\[x_{\text{new}} = x + \delta\,(x_{nn} - x), \qquad \delta \sim \mathcal{U}(0, 1).\]

Because \(\delta\) is uniform on \([0, 1]\), the new point lands somewhere between the two originals.

Variants#

  • Borderline-SMOTE — synthesises only near the decision boundary, where mistakes are most likely.

  • SMOTE-Tomek / SMOTE-ENN — pair SMOTE with a cleaning step that removes overlapping or noisy points.

  • ADASYN — generates more synthetic points for the minority samples that are hardest to learn.

Trade-offs#

Advantages:

  • Less overfitting than duplicating samples.

  • Smoother, more general boundaries and better minority-class scores.

Disadvantages:

  • Can create unrealistic points when the minority distribution is complex.

  • May push synthetic points into majority territory, causing class overlap.

  • More expensive than simple duplication.

Example#

With 100 minority and 1,000 majority samples, SMOTE generates 900 synthetic minority points, giving a balanced 1,000 vs 1,000.

from collections import Counter
from imblearn.over_sampling import SMOTE

print("before:", Counter(y))
X_res, y_res = SMOTE(k_neighbors=5, random_state=42).fit_resample(X, y)
print("after: ", Counter(y_res))

Theme: Imbalanced Learning & Resampling  ·  All terminology



See also

Source article Adapted (context, re-expressed) in our own words from: SMOTE (Synthetic Minority Over-sampling Technique) (insightful-data-lab.com).

Tags: purpose: reference topic: terminology level: intermediate