Skip to content
Calcrivo

Balanced Accuracy Calculator

Calculate balanced accuracy, the average of sensitivity and specificity, ideal for imbalanced datasets.

Inputs

Balanced Accuracy

0.80%

Sensitivity

0.62%

Specificity

0.98%

Step by step

  1. Sensitivity (recall): TP / (TP + FN)

    80 ÷ (80 + 50)

    = 0.6154

  2. Specificity: TN / (TN + FP)

    850 ÷ (850 + 20)

    = 0.9770

  3. Balanced accuracy: (sensitivity + specificity) / 2

    (0.6154 + 0.9770) ÷ 2

    = 0.7962

How it works

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)

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.

You might also need