SLSMOTE: The Safe-Level-SMOTE algorithm.

Description Usage Arguments Details Value References


SLSMOTE over-samples the input data set using the Safe-Level-SMOTE algorithm.


SLSMOTE(data, perc_min = 50, perc_over = NULL, k = 5,
  over_replace = FALSE, classes = NULL)



A data frame containing the predictors and the outcome. The predictors must be numeric and the outcome must be both a binary valued factor and the last column of data.


The desired % size of the minority class relative to the whole data set. For instance, if perc_min = 50 the returned data set is balanced. perc_min is ignored if perc_over is specified.


% of examples to append to the input data set relative to the size of the minority class. For instance, if perc_over = 100 the minority class doubles in size. If specified, perc_min is ignored.


Number of nearest neighbours to compute for each example in the minority class.


A logical value indicating whether the neighbours picked from the k nearest neighbours should be picked with or without replacement.


A named vector identifying the majority and the minority classes. The names must be "Majority" and "Minority". This argument is only useful if the function is called inside another sampling function.


Safe-Level-SMOTE works similarly to SMOTE. The difference is that Safe-Level-SMOTE associates a "level of safeness" to each minority example and uses this when synthesising new examples. The level of safeness of a minority example is defined as the number of minority examples among the k nearest neighbours of the example.

There are several rules used by Safe-Level-SMOTE to synthesise new examples. Apart from the situation where both minority examples have safe levels of zero, and no example is synthesised, the algorithm tends to synthesise new examples closer to the minority examples with safer levels.


A data frame containing a more balanced version of the input data after over-sampling with the Safe-Level-SMOTE algorithm.


Bunkhumpornpat, C., Sinapiromsaran, K., & Lursinsap, C. (2009). Safe-level-smote: Safe-level-synthetic minority over-sampling technique for handling the class imbalanced problem. Advances in knowledge discovery and data mining, 475-482.

RomeroBarata/bimba documentation built on May 17, 2019, 8:03 a.m.