Skip to content

Removed observations that are part of tomek links.

Usage

tomek(df, var)

Arguments

df

data.frame or tibble. Must have 1 factor variable and remaining numeric variables.

var

Character, name of variable containing factor variable.

Value

A data.frame or tibble, depending on type of df.

Details

All columns used in this function must be numeric with no missing data.

References

Tomek. Two modifications of cnn. IEEE Trans. Syst. Man Cybern., 6:769-772, 1976.

See also

step_tomek() for step function of this method

Other Direct Implementations: adasyn(), bsmote(), nearmiss(), smote(), smotenc()

Examples

circle_numeric <- circle_example[, c("x", "y", "class")]

res <- tomek(circle_numeric, var = "class")