Macro and Micro Averaging Across Classes

A macro average computes a metric per class and then averages those metrics. A micro average pools underlying counts before computing the metric.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace class recalls
  2. Choose the intended weighting
  3. Compare equal-class weighting with pooled decisions
  4. Specify missing classes and metric details

Trace class recalls

If one class has recall nine of ten and another one of two, macro recall is \((0.9+0.5)/2=0.7\). Pooled recall across those class counts is \(10/12\). See weighted summaries.

Choose the intended weighting

Equal class influence and equal observation influence answer different questions. Report which was used, including when a class has no evaluable cases. Group rate denominators explain why.[1][2]

Compare equal-class weighting with pooled decisions

Suppose class A has precision nine of ten and class B has precision one of two. Macro precision is the average of 0.9 and 0.5, giving 0.7. Micro precision on those counts is \(10/12\), about 0.833. See unequal group rates.

Class A: TP=9, predicted 10
Class B: TP=1, predicted 2
Macro: .7
Micro: 10/12

Specify missing classes and metric details

A class with no predicted positives needs a convention for macro precision. Other metrics have different counts and averaging behavior. Report support and formula.

References

  1. Gareth James et al., An Introduction to Statistical Learning ↩
  2. scikit-learn Developers, Metrics and Scoring: Quantifying the Quality of Predictions ↩