bal_oversampling: SMOTE-family class oversampling

View source: R/trans_sample_oversampling.R

bal_oversamplingR Documentation

SMOTE-family class oversampling

Description

Balance class distributions by generating synthetic minority examples with the SMOTE family (classic SMOTE, Borderline-SMOTE, ADASYN) or by random replication.

Usage

bal_oversampling(
  attribute,
  method = c("smote", "borderline", "adasyn", "random"),
  k = 5,
  m = 10,
  seed = NULL
)

Arguments

attribute

target class attribute name

method

oversampling strategy: "smote", "borderline", "adasyn" or "random"

k

number of nearest neighbors used to interpolate synthetic samples

m

number of neighbors used to assess the danger/difficulty of a minority instance (borderline/adasyn)

seed

optional seed for reproducibility

Details

All synthetic variants interpolate a base minority instance toward one of its k nearest minority neighbors; nominal features are set by majority vote among those neighbors (SMOTE-NC) instead of a coin flip. "borderline" synthesizes only from danger instances (those whose m nearest neighbors are mostly of other classes), concentrating new points near the decision boundary; "adasyn" allocates more synthetic samples to harder-to-learn minority instances.

Value

returns an object of class bal_oversampling

References

Chawla, N. V., Bowyer, K. W., Hall, L. O., & Kegelmeyer, W. P. (2002). SMOTE: Synthetic Minority Over-sampling Technique. Journal of Artificial Intelligence Research, 16:321-357. Han, H., Wang, W.-Y., & Mao, B.-H. (2005). Borderline-SMOTE: A New Over-Sampling Method in Imbalanced Data Sets Learning. In ICIC 2005, 878-887. He, H., Bai, Y., Garcia, E. A., & Li, S. (2008). ADASYN: Adaptive Synthetic Sampling Approach for Imbalanced Learning. In IJCNN 2008, 1322-1328.

Examples

data(iris)
iris_imb <- iris[c(1:50, 51:71, 101:111), ]
bal <- bal_oversampling("Species", method = "smote")
iris_bal <- transform(bal, iris_imb)
table(iris_bal$Species)

daltoolbox documentation built on Nov. 23, 2026, 9:08 a.m.