1) General Idea

  • Micro averaging aggregates the contributions of all classes before computing the metric.
  • In other words:
    • Add up True Positives (TP), False Positives (FP), and False Negatives (FN) across all classes.
    • Then compute the metric once from these totals.

Every sample has equal weight, not every class.


2) Example with Precision

Suppose 3 classes (A, B, C):

  • Class A: TP=90, FP=10
  • Class B: TP=30, FP=20
  • Class C: TP=5, FP=15

Macro Precision = (Prec_A + Prec_B + Prec_C)/3
= (90/100 + 30/50 + 5/20) / 3
= (0.90 + 0.60 + 0.25) / 3 = 0.583

Micro Precision = (TP_A + TP_B + TP_C) / (TP_A + TP_B + TP_C + FP_A + FP_B + FP_C)
= (90+30+5) / (90+30+5+10+20+15)
= 125 / 170 = 0.735

Notice:

  • Macro treats each class equally (so class C’s bad score hurts a lot).
  • Micro favors classes with more samples/events (so A dominates).

3) Micro Recall

Formula:

$\text{Micro Recall} = \frac{\sum_i TP_i}{\sum_i (TP_i + FN_i)}$

It’s the same as computing recall after pooling all classes.
In a single-label classification problem, micro precision = micro recall = accuracy.


4) Micro F1

  • Since micro precision = micro recall in single-label classification,
    Micro F1 = that same value.
  • In multi-label classification (where each sample can have multiple labels), micro F1 ≠ accuracy, but the same aggregation principle applies.

5) Micro AUROC

  • Similar to macro:
    • Collect all predictions and labels across classes.
    • Compute AUROC once across the pooled dataset.
  • Effectively, large classes dominate the AUROC score.

6) Quick Comparison Table

MethodWeighting principleGood for…
MacroEqual weight per classChecking fairness across classes (especially minority ones)
MicroEqual weight per sampleChecking overall performance, dominated by majority classes
WeightedWeight by class frequencyMiddle ground: balances per-class fairness with sample size

Summary:

  • Micro averaging = count everything first, compute once → focuses on overall accuracy-like behavior.
  • Macro averaging = compute per class, then average → focuses on balanced treatment of all classes.