Safe-Level SMOTE (SLSMOTE, 2009)
SLSMOTE.RdSLSMOTE() generates synthetic samples by considering a
safe level of the nearest minority class examples.
Arguments
- x
feature matrix or data.frame.
- y
a factor class variable. Can have more than two classes.
- k1
number of neighbors to link. Default is 5.
- k2
number of neighbors to determine safe levels. Default is 5.
- ovRate
Oversampling rate. Class \(j\) receives
round(ovRate * (n_max - n_j))synthetic samples, wheren_maxis the size of the largest class (halves are rounded up). Default is 1 meaning full balance. A vector with one value per class is also accepted.
Value
a list with resampled dataset.
- x_new
Resampled feature matrix.
- y_new
Resampled target variable.
- x_syn
Generated synthetic data.
- C
Number of synthetic samples for each positive class samples.
Details
Year: 2009.
SLSMOTE uses the safe-level distance metric to identify the minority class samples that are safe to oversample. Safe-level distance measures the distance between a minority class sample and its k-nearest minority class neighbors. A sample is considered safe to oversample if its safe-level is greater than a threshold. The safe-level of a sample is the ratio of minority class samples among its k-nearest neighbors.
In SLSMOTE, the oversampling process only applies to the safe minority class samples, which avoids the generation of noisy samples that can lead to overfitting. To generate synthetic samples, SLSMOTE randomly selects a minority class sample and finds its k-nearest minority class neighbors. Then, a random minority class neighbor is selected, and a synthetic sample is generated by adding a random proportion of the difference between the selected sample and its neighbor to the selected sample.
Can work with classes more than 2.
References
Bunkhumpornpat, C., Sinapiromsaran, K., & Lursinsap, C. (2009). Safe-level-smote: Safe-level-synthetic minority over-sampling technique for handling the class imbalanced problem. In Advances in Knowledge Discovery and Data Mining: 13th Pacific-Asia Conference, PAKDD 2009 Bangkok, Thailand, April 27-30, 2009 Proceedings 13 (pp. 475-482). Springer Berlin Heidelberg.

