mlr3 (version 0.3.0)

mlr_measures_classif.bacc: Balanced Accuracy

Description

Computes the weighted balanced accuracy, suitable for imbalanced data sets. It is defined analogously to the definition in sklearn.

First, the sample weights \(w\) are normalized per class: $$ \hat{w}_i = \frac{w_i}{\sum_j 1(y_j = y_i) w_i}. $$ The balanced accuracy is calculated as $$ \frac{1}{\sum_i \hat{w}_i} \sum_i 1(r_i = t_i) \hat{w}_i. $$

Arguments

Dictionary

This Measure can be instantiated via the dictionary mlr_measures or with the associated sugar function msr():

mlr_measures$get("bacc")
msr("bacc")

Meta Information

  • Type: "classif"

  • Range: \([0, 1]\)

  • Minimize: FALSE

  • Required prediction: response

See Also

Dictionary of Measures: mlr_measures

as.data.table(mlr_measures) for a complete table of all (also dynamically created) Measure implementations.

Other classification measures: mlr_measures_classif.acc, mlr_measures_classif.auc, mlr_measures_classif.bbrier, mlr_measures_classif.ce, mlr_measures_classif.costs, mlr_measures_classif.dor, mlr_measures_classif.fbeta, mlr_measures_classif.fdr, mlr_measures_classif.fnr, mlr_measures_classif.fn, mlr_measures_classif.fomr, mlr_measures_classif.fpr, mlr_measures_classif.fp, mlr_measures_classif.logloss, mlr_measures_classif.mbrier, mlr_measures_classif.mcc, mlr_measures_classif.npv, mlr_measures_classif.ppv, mlr_measures_classif.precision, mlr_measures_classif.recall, mlr_measures_classif.sensitivity, mlr_measures_classif.specificity, mlr_measures_classif.tnr, mlr_measures_classif.tn, mlr_measures_classif.tpr, mlr_measures_classif.tp

Other multiclass classification measures: mlr_measures_classif.acc, mlr_measures_classif.ce, mlr_measures_classif.costs, mlr_measures_classif.logloss, mlr_measures_classif.mbrier