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(), smotenc(), smote()

Examples

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

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

themis documentation built on Aug. 15, 2023, 1:05 a.m.