balance: Measures of class balance

Description Usage Arguments Details Value References See Also Examples

View source: R/balance.R

Description

Classification task. These measures capture the differences in the number of examples per class in the dataset. When these differences are severe, problems related to generalization of the ML classification techniques could happen because of the imbalance ratio.

Usage

1
2
3
4
5
6
7
balance(...)

## Default S3 method:
balance(x, y, measures = "all", ...)

## S3 method for class 'formula'
balance(formula, data, measures = "all", ...)

Arguments

...

Not used.

x

A data.frame contained only the input attributes.

y

A factor response vector with one label for each row/component of x.

measures

A list of measures names or "all" to include all them.

formula

A formula to define the class column.

data

A data.frame dataset contained the input attributes and class.

Details

The following measures are allowed for this method:

"B1"

The entropy of class proportions (B1) capture the imbalance in a dataset based on the proportions of examples per class.

"B2"

The imbalance ratio (B2) is an index computed for measuring class balance. This is a version of the measure that is also suited for multiclass classification problems.

Value

A list named by the requested class balance measure.

References

Ana C Lorena, Ivan G Costa, Newton Spolaor and Marcilio C P Souto. (2012). Analysis of complexity indices for classification problems: Cancer gene expression data. Neurocomputing 75, 1, 33–42.

Ajay K Tanwani and Muddassar Farooq. (2010). Classification potential vs. classification accuracy: a comprehensive study of evolutionary algorithms with biomedical datasets. Learning Classifier Systems 6471, 127–144.

See Also

Other complexity-measures: correlation(), dimensionality(), featurebased(), linearity(), neighborhood(), network(), smoothness()

Examples

1
2
3
## Extract all balance measures for classification task
data(iris)
balance(Species ~ ., iris)

lpfgarcia/ECoL documentation built on Dec. 22, 2020, 1:41 a.m.