Learn R Programming

wconf (version 1.2.0)

balancedaccuracy: Starovoitov-Golub Sine-Accuracy Function for Imbalanced Classification Data

Description

This function calculates classification accuracy scores using the sine-based formulas proposed by Starovoitov and Golub (2020). The advantage of the new method consists in producing improved results when compared with the standard balanced accuracy function, by taking into account the class distribution of errors.

Usage

balancedaccuracy(m, print.scores = TRUE)

Value

a list containing 5 elements: 3 overall and 2 class accuracy scores

Arguments

m

the caret confusion matrix object or simple matrix.

print.scores

print the accuracy metrics.

Author

Alexandru Monahov, <https://www.alexandrumonahov.eu.org/>

Details

The input object "m" should be a square matrix of at least size 2x2.

See Also

[wconfusionmatrix()]

Examples

Run this code
m = matrix(c(70,0,0,10,10,0,5,3,2), ncol = 3, nrow=3)
balancedaccuracy(m, print.scores = TRUE)

Run the code above in your browser using DataLab