oversample_smote: Oversample a dataset by SMOTE.

View source: R/oversample.R

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

scutr documentation built on Nov. 18, 2023, 1:08 a.m.