Notes

SMOTE-ENN

When one class is rare—fraud transactions, disease positives, customer churn—models can learn to “play it safe” by predicting the majority class. SMOTE-ENN is a practical way to fight that by both creating better minority examples and cleaning up messy boundary points.

What SMOTE-ENN is

SMOTE-ENN is a hybrid resampling method that combines SMOTE (Synthetic Minority Over-sampling Technique) with ENN (Edited Nearest Neighbors). The idea is simple: first, add synthetic minority samples to reduce imbalance; then, remove samples (from either class) that look like noise or are likely mislabeled because they disagree with their nearest neighbors. This pairing targets two common problems at once: too few minority examples and a “fuzzy” decision boundary caused by overlap and outliers.

How it works mechanically

  • SMOTE step: for each minority point, pick one of its k nearest minority neighbors and create a synthetic point along the line segment between them. This expands minority regions without just duplicating rows.
  • ENN step: for each sample, look at its k nearest neighbors; if its label disagrees with the majority of those neighbors, drop it. This typically removes borderline majority points and isolated minority noise.

Why it matters in real models

In tasks like credit-card fraud detection, SMOTE alone can add synthetic points into overlapping regions, increasing false positives. ENN helps “edit” those ambiguous areas, often improving precision/recall trade-offs and making classifiers like LogisticRegression, RandomForest, or XGBoost behave more sensibly. In practice you’ll see it in imblearn as:

from imblearn.combine import SMOTEENN
X_res, y_res = SMOTEENN(random_state=0).fit_resample(X_train, y_train)

SMOTE-ENN is a hybrid resampling method for imbalanced classification that combines SMOTE (Synthetic Minority Over-sampling Technique) to generate minority-class synthetic samples with ENN (Edited Nearest Neighbors) to remove ambiguous or noisy points from both classes based on nearest-neighbor disagreement. It matters because it simultaneously increases minority representation and cleans class overlap, improving decision boundaries and downstream classifier performance on skewed datasets.

Imagine you’re trying to learn what “fraud” looks like from past transactions, but you only have a handful of fraud examples and thousands of normal ones. You might make extra practice cards for the rare cases, then throw out the messy cards that confuse you.

SMOTE-ENN is a two-step way to do that for training data. SMOTE makes new, believable examples of the rare class (like fraud) so the model gets enough practice. ENN then cleans up by removing data points that look like they don’t match their neighbors—often noisy or borderline cases. The goal is a cleaner, more balanced dataset so the model learns fairer decision boundaries.