oversample_smote {scutr}R Documentation

Oversample a dataset by SMOTE.

Description

Oversample a dataset by SMOTE.

Usage

oversample_smote(data, cls, cls_col, m, k = NA)

Arguments

data

Dataset to be oversampled.

cls

Class to be oversampled.

cls_col

Column containing class information.

m

Desired number of samples in the oversampled data.

k

Number of neighbors used in SMOTE() to generate synthetic minority instances. This value must be smaller than the number of minority instances already present for a given class. If NA, min(5, n-1) is chosen, where n is the number of instances of the minority class.

Value

The oversampled dataset.

Examples

table(iris$Species)
smoted <- oversample_smote(iris, "setosa", "Species", 100)
nrow(smoted)

[Package scutr version 0.2.0 Index]