Balanced Accuracy Calculator
Calculate balanced accuracy to fairly evaluate models on imbalanced datasets.
About Balanced Accuracy Calculator
Balanced accuracy averages the model's performance on each class separately: bal_acc = (sensitivity + specificity) / 2, where sensitivity is the true positive rate and specificity is the true negative rate. Because it weighs both classes equally regardless of how many examples each contains, balanced accuracy avoids the trap of standard accuracy on imbalanced datasets — a model that always predicts the majority class scores around 0.5 on balanced accuracy, correctly revealing it has no real skill.
Formula
balanced_accuracy = (sensitivity + specificity) / 2
- Sensitivity
- TP / (TP + FN)
- Specificity
- TN / (TN + FP)
Worked example
With the default values below, Balanced Accuracy Calculator returns Balanced Accuracy of 0.80%. Change any input above and every figure here is recalculated in your browser.
Inputs used
- True Positives (TP)accepts 0–1,000,000,000
- 80
- True Negatives (TN)accepts 0–1,000,000,000
- 850
- False Positives (FP)accepts 0–1,000,000,000
- 20
- False Negatives (FN)accepts 0–1,000,000,000
- 50
Results
- Balanced Accuracy
- 0.80%
- Sensitivity
- 0.62%
- Specificity
- 0.98%
Step by step
- 1Sensitivity (recall): TP / (TP + FN)= 0.6154
- 2Specificity: TN / (TN + FP)= 0.9770
- 3Balanced accuracy: (sensitivity + specificity) / 2= 0.7962
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How does balanced accuracy differ from regular accuracy?
Regular accuracy weighs every prediction equally, so it's dominated by the majority class on imbalanced data; balanced accuracy instead averages the per-class recall rates, giving each class equal importance regardless of its size.
What does a balanced accuracy of 0.5 mean?
A balanced accuracy of 0.5 (50%) indicates the classifier performs no better than random guessing when both classes are weighted equally — a common result for a model that just predicts the majority class every time.
Is balanced accuracy the same as MCC?
No — they're both robust to class imbalance but computed differently; MCC uses a correlation-style formula incorporating all four confusion matrix cells simultaneously, while balanced accuracy is simply the arithmetic mean of sensitivity and specificity.
