Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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)

Arguments

data

Data to be undersampled.

cls

Class to be undersampled.

cls_col

Class column.

m

Number of samples in undersampled dataset.

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

Balancing Multiclass Datasets for Classification Tasks

v0.1.2
MIT + file LICENSE
Authors
Keenan Ganz [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.