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

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

data(glass0) imbalanceRatio(glass0, classAttr = "Class")
#> [1] 0.4861111