tomek: Remove Tomek's links

View source: R/tomek_impl.R

tomekR Documentation

Remove Tomek's links

Description

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.

Details

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

Value

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

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")

tidymodels/themis documentation built on Jan. 23, 2025, 8:23 a.m.