Learn R Programming

scutr (version 0.2.0)

undersample_mclust: Undersample a dataset by expectation-maximization clustering

Description

Undersample a dataset by expectation-maximization clustering

Usage

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

Value

The undersampled dataframe containing only instance of cls.

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

Examples

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

Run the code above in your browser using DataLab