SMOTE
SMOTE creates feature vectors between nearby examples of a selected class. Instead of repeating a minority row exactly, it chooses a minority neighbor and moves some fraction of the way toward it. The generated row receives that same class label.
The central assumption is geometric: points along that segment should make useful examples of the class. We will inspect one segment at a time, then examine when that assumption can fail.
Separate the choice of parents from the interpolation
We describe basic SMOTE as implemented by imbalanced-learn. For a fixed neighborhood size, its generation step samples seed–neighbor pairs randomly. It does not allocate extra rows using a fitted classifier’s mistakes; ADASYN introduces a separate neighborhood-based allocation rule.
Write the equation after following one move
Let the seed be $x_i=(1,1)$ and its chosen neighbor be $x_j=(3,2)$. The displacement toward the neighbor is $x_j-x_i=(2,1)$. Moving one quarter of that displacement gives $(1,1)+0.25(2,1)=(1.5,1.25)$.
Writing the movement fraction as $\lambda$, the general interpolation is
Use one fraction for the whole vector. Choosing a different fraction independently for each coordinate generally produces a point inside a box, not on the selected segment. At 0 the result is the seed; at 1 it is the neighbor.
A = (1, 1), B = (3, 2), C = (2, 5). With k = 2, either other minority point is an eligible neighbor.
The distance calculation is a modeling choice
The neighbor search uses the class being expanded, not the whole dataset. A majority point can lie near or even on a selected segment without being used as a parent. Basic SMOTE does not check that the segment stays away from the other class.
Feature units affect which points are nearest. Fit a suitable scaling policy on the training data before the neighbor search. Also consider whether distance in this feature representation has useful meaning; scaling alone cannot establish that.
With $n_c$ rows in a class, an integer neighborhood size must satisfy $k<n_c$ to exclude the seed itself. The default k = 5 therefore needs at least six rows in that class in each training fold. Our three-point example deliberately uses k = 2. Duplicate coordinates can still give zero-length segments and repeated synthetic values.
Check whether the segment contains valid examples
Suppose two features encode a vector that must have length 1. The endpoints (1, 0) and (0, 1) are valid. Their midpoint (0.5, 0.5) has squared length 0.5, so it violates that constraint.
Other examples include categorical codes, integer counts and coupled physical measurements. Interpolating one-hot category vectors can produce fractions that do not represent a category. For mixed numeric and categorical data, consider SMOTENC; for entirely categorical data, SMOTEN uses a different generation procedure.
Large neighborhoods can connect distinct minority groups through a majority region. Sparse minority data or mislabeled seeds can also generate misleading points. Inspect representative parent pairs and generated examples, and compare with exact oversampling, weighting and no resampling. More synthetic rows do not provide more independent labels.
Fit the geometry and sampler inside training
Split original observations first. Inside each training fold, fit any imputation and scaling, apply SMOTE, then fit the classifier. Evaluate the fitted pipeline on original validation observations. Never generate synthetic neighbors using validation or test rows.
Scaling before SMOTE learns a different neighbor geometry from an unscaled feature space. Choose the scaling, $k$ and sampling target through validation, checking the minority count in each fold. The sampler is bypassed during prediction; it does not alter the validation population.
References and further reading
- Chawla et al.: SMOTE—Synthetic Minority Over-sampling Technique — the original feature-space interpolation method, Section 4.2.
- Imbalanced-learn: sample generation — shared-fraction interpolation and differences among synthetic samplers.
- Imbalanced-learn: SMOTE — target counts, neighborhood configuration and fitted sampler state.
- Imbalanced-learn: synthetic oversampling and categorical variants — feature-type limitations and SMOTENC/SMOTEN alternatives.
- Imbalanced-learn: leakage from resampling — why neighbor generation must remain inside training.