Module 3 · Evaluation/Lesson 23 of 33

Macro vs Micro Averaging

80/15/5 class splits: the same predictions can look excellent or broken depending on how you average.

Intermediate 25 minPipeline: Evaluation
Mastery—
Quiz
—
Exercises
—
Challenge
—

Why this matters

With three intent classes — Interested 80%, Not Interested 15%, Ambiguous 5% — a model can ignore the rare class entirely and still report a strong single number. Whether that number is , or decides whether anyone notices.

The rare class is often the one the business cares about most (ambiguous calls needing review, compliance violations). Averaging is a choice about whose performance counts.

Core concept

Technical explanation + simple intuition + example

Three ways to average

  • Micro: pool every decision, then compute one F1. Big classes dominate. (For single-label multi-class, micro-F1 = accuracy.)
  • Macro: compute F1 per class, then take the plain average. Every class counts equally.
  • Weighted: average per-class F1 weighted by class size. Close to micro in practice.

The 10 questions

Every important concept should answer all of these

1What is it?

Ways to combine per-class metrics into one number: pooled (micro), unweighted mean (macro), or support-weighted mean (weighted).

2Why does it exist?

Imbalanced classes make a single summary misleading unless the averaging matches your priorities.

3What problem does it solve?

It reveals (or hides) performance on rare classes.

4How does it work internally?

Compute per-class P/R/F1 from the confusion matrix, then average as required; always show the per-class table.

5What does it look like on real transcript data?

Intent, objection and compliance labels are heavily imbalanced; rare classes carry disproportionate business value.

6What can go wrong?

Reporting weighted-F1 (sklearn default summary line) and missing a failing rare class; comparing micro-F1 of one system with macro-F1 of another.

7How do I evaluate it?

Always report the per-class table plus macro-F1; add micro/weighted for context.

8When should I use it?

Macro when every class matters; micro when per-decision accuracy matters and classes are balanced in importance.

9When should I NOT use it?

Don't use micro/weighted as the only headline on imbalanced tasks.

10How does it affect downstream systems?

The averaging choice shapes model selection and prompt iteration: optimize macro and you'll work on rare classes.

Interactive lab: Averaging lab

Edit a 3×3 confusion matrix for an 80/15/5 dataset. See per-class precision/recall/F1 and how accuracy, micro-, weighted- and macro-F1 diverge. Try the preset that ignores the rare class.

LIVE COMPUTATION
Loading lab…

Try it yourself

Conceptual (A), applied (B) and engineering (C) exercises

Q1Type A · ConceptualBeginner
For single-label multi-class classification, micro-F1 equals…
Q2Type B · AppliedIntermediate
Per-class F1: Interested 0.95, Not Interested 0.80, Ambiguous 0.10. Compute macro-F1 (3 decimals).
Q3Type B · AppliedIntermediate
Same per-class F1 (0.95, 0.80, 0.10) with supports 800, 150, 50. Compute weighted-F1 (3 decimals).
Q4Type C · EngineeringAdvanced
A stakeholder's dashboard shows weighted-F1 0.89 and they want to stop improving the model. The 5% 'Ambiguous' class has F1 0.10 and drives human-review routing. What do you propose?

Graded by a transparent keyword rubric (not an LLM) — it checks for the key ideas, then shows a model answer for self-assessment.

Real-world application

An objection classifier reported weighted-F1 0.86 for months. A new product manager asked for the per-class table: "documentation concern" (6% of calls) had F1 0.21. That class drove the most fixable drop-offs. Switching the headline metric to macro-F1 redirected work to the rare classes; macro-F1 rose from 0.58 to 0.74 in two iterations while weighted-F1 barely moved.

Common mistakes

Reading only sklearn's 'weighted avg' line

It's dominated by the largest class.

Fix: Read the per-class rows and macro average.

Thinking micro-F1 ≠ accuracy in single-label tasks

They're identical there.

Fix: Know that micro-F1 adds nothing over accuracy for single-label multi-class.

Comparing different averages across reports

Apples vs oranges.

Fix: Fix the averaging method in the evaluation spec.

Engineering decision

Which average should be your headline?

Use it when
  • Macro-F1: every class matters, especially rare ones
  • Micro/accuracy: balanced importance per decision
  • Per-class table: always, alongside any average
Avoid it when
  • Weighted/micro alone on imbalanced tasks with important rare classes
Trade-offs
Macro vs Micro
Macro is sensitive to rare-class noise (few examples → wide CIs); micro hides rare-class failure.

Quiz

Pass mark 60%. Missed questions go to your mistake log and spaced review.

0/5 answered
Q1Beginner
Macro-F1 gives each class…
Q2Intermediate
A model never predicts the 5% 'Ambiguous' class. Which metric drops most?
Q3Intermediate
When would you prefer micro-averaged metrics?
Q4Intermediate
Why can macro-F1 be noisy on small evaluation sets?
Q5Advanced
System A: macro-F1 0.74. System B: micro-F1 0.91. Which is better?

Advanced challenge

Type C · EngineeringAdvanced
Write the evaluation spec paragraph for an objection classifier with 6 classes (one is 3% of traffic but most actionable). What do you report and why?

Graded by a transparent keyword rubric (not an LLM) — it checks for the key ideas, then shows a model answer for self-assessment.

Key terms in this lesson