Home Knowledge Base SMOTE (Synthetic Minority Over-sampling Technique)

SMOTE (Synthetic Minority Over-sampling Technique) is the most widely used algorithm for handling imbalanced datasets — creating synthetic examples of the minority class by interpolating between existing minority samples rather than simply duplicating them, which expands the decision boundary and helps the model generalize to unseen minority examples instead of memorizing the few available ones, making it the standard approach for fraud detection, medical diagnosis, and any classification task where one class is dramatically underrepresented.

What Is SMOTE?

How SMOTE Works

StepProcessExample
1. Select minority sample APick a fraud transactionFeature vector: [amount=$500, time=2am]
2. Find K nearest minority neighborsK=5 nearest fraud pointsNeighbor B: [amount=$800, time=3am]
3. Pick one neighbor randomlyChoose neighbor B
4. Generate synthetic point on line A→BRandom point between A and BNew: [amount=$650, time=2:30am]
5. Repeat until balancedContinue until minority count matches majority

Formula: $X_{new} = X_A + lambda imes (X_B - X_A)$ where $lambda in [0, 1]$ is random.

SMOTE Variants

VariantModificationWhen to Use
SMOTE (original)Interpolate between any minority neighborsGeneral imbalance
Borderline-SMOTEOnly oversample minority points near the decision boundaryWhen boundary samples matter most
SMOTE-ENNSMOTE + remove noisy samples (Edited Nearest Neighbors)Reduce overlap after oversampling
SMOTE-TomekSMOTE + remove Tomek links (ambiguous boundary pairs)Cleaner decision boundaries
ADASYNGenerate more synthetic samples for harder-to-learn minority examplesAdaptive to local difficulty
SMOTE-NCHandles mixed numeric + categorical featuresDatasets with categorical columns

SMOTE vs Alternatives

TechniqueApproachProsCons
Random OversamplingDuplicate minority examplesSimpleOverfitting on duplicates
SMOTEInterpolate new minority examplesBetter generalizationCan create noisy examples in overlapping regions
Random UndersamplingRemove majority examplesFast, reduces data sizeLoses potentially useful majority info
Class WeightsIncrease loss penalty for minorityNo data manipulationDoesn't add new information
ADASYNAdaptive SMOTE (more synthetics for harder examples)Focuses on hard casesMore complex

Python Implementation

from imblearn.over_sampling import SMOTE

smote = SMOTE(random_state=42, k_neighbors=5)
X_resampled, y_resampled = smote.fit_resample(X_train, y_train)
# Now minority class has same count as majority

Critical Rule: Only apply SMOTE to training data, NEVER to test/validation data. Synthetic examples in the test set would give inflated performance estimates.

SMOTE is the standard oversampling algorithm for imbalanced classification — creating synthetic minority examples through feature-space interpolation that expands the decision boundary and improves generalization, with variants like Borderline-SMOTE and SMOTE-ENN that further refine the synthetic samples for cleaner class separation.

smoteoversampleimbalanced

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.