imbalanceRatio: Compute imbalance ratio of a binary dataset

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Given a two-class dataset, it computes its imbalance ratio as {Size of minority class}/{Size of majority class}

Usage

1
imbalanceRatio(dataset, classAttr = "Class")

Arguments

dataset

A target data.frame to compute its imbalance ratio

classAttr

A character containing the class name attribute.

Value

A real number in [0,1] representing the imbalance ratio of dataset

Examples

1
2
3
data(glass0)

imbalanceRatio(glass0, classAttr = "Class")

Example output

[1] 0.4861111

imbalance documentation built on April 14, 2020, 6:02 p.m.