{
  "slug": "balanced-accuracy",
  "term": "Balanced accuracy",
  "aliases": [
    "macro-averaged recall"
  ],
  "definition": "Balanced accuracy is the arithmetic mean of the recalls for the evaluated classes, assigning equal weight to each class.",
  "note": "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. [brodersen]\n\nIn 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%. [worked]\n\nEqual 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. [brodersen] [balanced-api]\n\nFor 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. [balanced-api] [brodersen]",
  "related": [
    "confusion-matrix",
    "specificity",
    "recall",
    "precision",
    "false-positive-rate",
    "class-prevalence",
    "matthews-correlation-coefficient"
  ],
  "citations": [
    {
      "id": "brodersen",
      "title": "Brodersen, Ong, Stephan and Buhmann (2010). The balanced accuracy and its posterior distribution, section III. DOI: 10.1109/ICPR.2010.764.",
      "url": "https://kaybrodersen.github.io/publications/Brodersen_2010b_ICPR.pdf",
      "accessed": "2026-11-22"
    },
    {
      "id": "balanced-api",
      "title": "scikit-learn: balanced_accuracy_score; macro recall, balanced sample weights and chance adjustment.",
      "url": "https://scikit-learn.org/stable/modules/generated/sklearn.metrics.balanced_accuracy_score.html",
      "accessed": "2026-11-22"
    },
    {
      "id": "worked",
      "title": "Hesela: synthetic classification counts, exact fractions and edge-case checks.",
      "url": "https://hesela.dev/research/classification-denominators/results.json",
      "accessed": "2026-11-22"
    }
  ],
  "provenance": [
    "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."
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-22"
}
