BorderlineSmoteAugmenter<T>
Models & Types · AiDotNet.Augmentation.Tabular
Implements Borderline-SMOTE for imbalanced datasets, focusing on samples near the decision boundary.
Inheritance: AugmentationBase<T, Matrix<T>> → TabularAugmenterBase<T> → BorderlineSmoteAugmenter<T>
For Beginners
Borderline-SMOTE is an improvement over standard SMOTE that only generates synthetic samples from minority instances that are near the decision boundary (i.e., in “danger” zones where they have majority class neighbors). This focuses synthetic data generation where it matters most.
How It Works
How it works:
-
For each minority sample, find its k nearest neighbors from BOTH classes
-
Classify each minority sample as:
-
SAFE: Most neighbors are minority class (not used for synthesis)
-
DANGER: Half to most neighbors are majority class (used for synthesis)
-
NOISE: All neighbors are majority class (ignored)
-
Only generate synthetic samples from DANGER samples
Borderline-SMOTE Variants:
- Borderline-SMOTE1: Synthetic samples interpolate only between DANGER samples and minority neighbors
- Borderline-SMOTE2: Synthetic samples can also interpolate toward majority neighbors
This implementation uses Borderline-SMOTE1 by default, configurable via UseBorderline2.
When to use:
- When standard SMOTE generates too many samples in easy regions
- When you want to focus on the challenging boundary between classes
- When minority samples near the boundary are most important
Reference: Han et al., “Borderline-SMOTE: A New Over-Sampling Method in Imbalanced Data Sets Learning” (2005)
Constructors
| Constructor | Summary |
|---|---|
BorderlineSmoteAugmenter(int kNeighbors, int mNeighbors, double samplingRatio, bool useBorderline2, double probability) |
Creates a new Borderline-SMOTE augmenter. |
Properties
| Property | Summary |
|---|---|
bool UseBorderline2 { get; } |
Gets whether to use Borderline-SMOTE2 (can interpolate toward majority). |
double SamplingRatio { get; } |
Gets the sampling ratio for synthetic sample generation. |
int KNeighbors { get; } |
Gets the number of nearest neighbors to consider. |
int MNeighbors { get; } |
Gets the number of minority neighbors to use for interpolation. |
Methods
| Method | Summary |
|---|---|
IDictionary<string, object> GetParameters() |
|
Matrix<T> GenerateSyntheticSamples(Matrix<T> minorityData, Matrix<T> majorityData, AugmentationContext<T> context) |
Applies Borderline-SMOTE to generate synthetic samples for the minority class. |