undersample_mclust: Undersample a dataset by expectation-maximization clustering

View source: R/undersample.R

undersample_mclustR Documentation

Undersample a dataset by expectation-maximization clustering

Description

Undersample a dataset by expectation-maximization clustering

Usage

undersample_mclust(data, cls, cls_col, m, ...)

Arguments

data

Data to be undersampled.

cls

Class to be undersampled.

cls_col

Class column.

m

Number of samples in undersampled dataset.

...

Additional arguments passed to Mclust()

Value

The undersampled dataframe containing only instance of cls.

Examples

setosa <- iris[iris$Species == "setosa", ]
nrow(setosa)
undersamp <- undersample_mclust(setosa, "setosa", "Species", 15)
nrow(undersamp)

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