Balanced accuracy
Balanced accuracy is the arithmetic mean of the recalls for the evaluated classes, assigning equal weight to each class.
For binary decisions with both observed classes present, balanced accuracy = (TP/(TP+FN) + TN/(TN+FP))/2: the mean of sensitivity and specificity. Ordinary accuracy instead divides all correct decisions by all observations. [1]
In a synthetic set of 100 positive and 9900 negative decisions, TP=90, FN=10, FP=99 and TN=9801 give balanced accuracy 94.5%, ordinary accuracy 98.91% and precision about 47.62%. Predicting every case negative raises ordinary accuracy to 99% but lowers balanced accuracy to 50%. [3]
Equal class weighting does not encode replacement cost, missed-failure cost or an alert budget. The score summarizes one decision rule, not the entire score ranking. If an intended class has no observed support, its recall and the fixed-class average are undefined; state the evaluated class set and software convention. [1] [2]
For K >= 2 supported classes, chance-adjusted balanced accuracy is (BA - 1/K)/(1 - 1/K), which is 2*BA - 1 for two classes. State whether adjustment and sample weights were used. The empirical score is distinct from a Bayesian posterior summary; smoothing per-class probabilities changes the estimate. [2] [1]
Relations
- related
- Confusion matrix, Specificity, Recall, Precision, False positive rate, Class prevalence, Matthews correlation coefficient
Citations
- Brodersen, Ong, Stephan and Buhmann (2010). The balanced accuracy and its posterior distribution, section III. DOI: 10.1109/ICPR.2010.764.
- scikit-learn: balanced_accuracy_score; macro recall, balanced sample weights and chance adjustment.
- Hesela: synthetic classification counts, exact fractions and edge-case checks.
Sources & caveats
- Reviewed 2026-11-22: Brodersen et al., full four-page paper, especially the section III definition and model assumptions; scikit-learn API.
- The example is synthetic arithmetic, not a reproduction of the paper's experiments. Exact counts and absent-class behavior are checked in the linked model.
- The model uses a fixed binary class set and returns null for unsupported class rates. It does not claim to duplicate every library's absent-class convention.