Skip to content
EvalSuite
Documentation menu

Classification

Balanced accuracy

Implementedclassification.balanced_accuracy

Definition

Mean of per-class recall. Reduces the influence of class imbalance compared with accuracy.

Formula

Balanced accuracy = (1/K) Σₖ TPₖ / (TPₖ + FNₖ)

Range: [0, 1]

Inputs and outputs

  • y_true: array of class labels
  • y_pred: array of predicted labels

Returns: float

Assumptions

No assumptions beyond valid, aligned inputs of the documented types.

Limitations

No metric-specific limitations are documented yet. Interpret the value alongside the task, data, and other metrics.

Python API

PythonSince v0.1.0
import evalsuite as es

es.balanced_accuracy(y_true, y_pred)

References

  1. Brodersen, K. H., Ong, C. S., Stephan, K. E., & Buhmann, J. M. (2010). The balanced accuracy and its posterior distribution. Proceedings of the 20th International Conference on Pattern Recognition, 3121–3124.

Implementation status