📏  Macro Averaging

Macro Averaging#

Computing a metric per class then averaging them equally.

Important

✨ AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.

What it is#

Macro averaging computes the metric separately for each class (one-vs-rest), then takes the unweighted arithmetic mean. Every class counts the same, no matter how many samples it has:

\[P_{\text{macro}} = \frac{1}{C}\sum_{c=1}^{C}\frac{TP_c}{TP_c + FP_c}.\]

Its behavior#

Because each class contributes equally, macro averaging punishes ignoring minorities — a model that aces the majority but fails a rare class gets a low macro score. That makes it sensitive to rare-class performance and a natural fairness-oriented headline.

When to use it#

Use macro averaging when all classes matter equally, especially on imbalanced data where you don’t want the majority to drown out the rest. It can, however, look pessimistic if some tiny classes are inherently hard.


Theme: Classification & Averaging Metrics  ·  All terminology



See also

Source article Adapted (context, re-expressed) in our own words from: Macro Averaging (insightful-data-lab.com).

Tags: purpose: reference topic: terminology level: intermediate