Formula used
Balanced accuracy gives every class equal influence. It is useful when class sizes differ. Ordinary accuracy can hide minority-class failures.
For multiclass tasks, calculate recall separately for each class. Then average the defined class recalls. The calculator also shows one-versus-rest specificity.
How to use
- Select binary counts, a multiclass matrix, or label lists.
- Enter non-negative whole-number counts or matching label sequences.
- Choose zero-division, precision, format, and detail settings.
- Press the calculation button and review warnings.
- Compare balanced accuracy against standard and baseline accuracy.
- Copy, export, or print the completed report.
Example data
| Example | Input | Learning point |
|---|---|---|
| Balanced binary | TP 45, TN 45, FP 5, FN 5 | Accuracy and balanced accuracy are equal. |
| Imbalanced binary | TP 42, TN 810, FP 90, FN 8 | Balanced accuracy reveals both class recalls. |
| Three classes | 38,2,0 / 5,29,6 / 1,4,15 | Each class contributes one recall value. |
| Majority prediction | TP 0, TN 900, FP 0, FN 100 | High accuracy can coexist with poor balance. |
Understanding the result
A score near one indicates strong recall across classes. A score near the class-count baseline suggests random performance. Scores below baseline may reveal reversed predictions.
Thresholds are guidance rather than universal rules. Medical, fraud, and safety applications need stricter review. Always inspect per-class recall and error costs.
Frequently asked questions
Why use balanced accuracy?
It prevents large classes from dominating the headline score. Every class recall contributes equally.
Is balanced accuracy the same as accuracy?
No. Accuracy counts all correct predictions together. Balanced accuracy averages class-level recall.
What is balanced accuracy for binary classification?
It is the average of sensitivity and specificity. Both classes receive equal weight.
How is multiclass balanced accuracy calculated?
Calculate recall for every class, then average those recalls. Undefined classes follow the selected policy.
What does adjusted balanced accuracy mean?
It removes the expected chance baseline. Zero then represents chance-level performance.
Can balanced accuracy be negative?
Raw balanced accuracy is normally between zero and one. Its adjusted version can become negative.
What happens when a class has no samples?
Its recall is undefined. Choose whether to display, replace, ignore, or stop.
Should specificity be averaged for multiclass models?
Specificity can provide additional insight. Standard multiclass balanced accuracy primarily averages recall.
Which other metrics should I inspect?
Review precision, F1, MCC, confusion counts, class support, and application-specific error costs.