Macro vs micro vs weighted averaging in multi-class metrics — how do you choose?
mediumAnswer
- Macro: compute metric per class, then average with equal weight.
- Treats each class equally — useful when small classes matter (e.g., rare diseases).
- Micro: aggregate TP/FP/FN across all classes then compute the metric globally.
- Dominated by frequent classes; equals accuracy for single-label problems.
- Weighted: per-class metric weighted by class support.
- Compromise between macro and micro.
- Rule of thumb: report macro when classes have unequal importance; micro/weighted when the aggregate is the target.
Check yourself — multiple choice
- Micro and macro are always identical
- Macro: per-class average (equal weight). Micro: aggregated globally (dominated by frequent classes). Weighted: by class support.
- Macro averaging is only for regression
- Weighted averaging equals micro averaging
Macro = equal per-class; micro = pooled globally; weighted = weighted by support.
#metrics#classification#multiclass
Practise Supervised Learning
215 interview questions in this topic.
Related questions
- What is top-k accuracy and when do you use it?
- Precision vs recall — when do you optimize each?
- How do you read a confusion matrix and derive the key metrics?
- One-vs-Rest, One-vs-One, and softmax — how do you choose for multi-class?
- 'multinomial' vs 'ovr' setting in scikit-learn's LogisticRegression — what changes?
- Why is accuracy a bad primary metric for many real-world problems?