Join our Newsletter — 33% off our NHI Course
Home› FAQ› AI Security› What is the difference between macro F1, micro…
AI Security

What is the difference between macro F1, micro F1, and weighted F1 in multiclass evaluation?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 30, 2026 Domain: AI Security

Macro F1 gives each class equal weight, so rare classes matter as much as common ones. Micro F1 pools all predictions first, so frequent classes dominate the result. Weighted F1 averages class scores by support, which keeps class imbalance visible without treating every class identically. The right choice depends on whether fairness, overall correctness, or prevalence should drive evaluation.

Why the three F1 averages answer different evaluation questions

macro f1, micro F1, and weighted F1 are not competing definitions of the same thing, they answer different questions about a multiclass model. macro F1 treats each class as equally important, micro F1 treats each individual prediction equally, and weighted F1 keeps class support in the calculation so large classes influence the final score more than small ones.

The practical difference is that the same confusion matrix can produce very different impressions of model quality depending on which average you choose. That is why the metric should match the decision you are trying to support, not just the one that looks best in a report.

When class distribution is skewed, the choice matters even more. A model can look strong on micro F1 while doing poorly on minority classes, while macro F1 can expose that weakness by giving each class equal standing. Weighted F1 sits between those two views, because it reflects per-class performance but still lets common classes shape the headline number.

How macro, micro, and weighted F1 behave in practice

Macro F1 is the fairest view when every class matters operationally and a weak minority class should not be hidden by strong performance on common classes. It is often the best summary when you care about balanced performance across categories, such as safety-critical labels, rare fraud patterns, or any class where missing the minority outcome is costly.

Micro F1 is the most prevalence-sensitive view, because it aggregates the underlying counts before computing precision and recall. That makes it useful when you care about overall correctness across all decisions, but it can understate poor minority-class behaviour because frequent classes dominate the total.

Weighted F1 is useful when you want a single number that still reflects imbalance without pretending every class is equally important. It is often the most comfortable summary for reporting, because it preserves some sensitivity to class imbalance while remaining closer to the dataset’s true class mix than macro F1 does.

For a worked evaluation guide on how class composition affects segmentation and operational controls, see the Microsegmentation Buyers Guide, which is helpful where evaluation criteria depend on how well controls handle different traffic and policy patterns.

Choosing the right F1 average for the decision you need to make

The right choice depends on what failure you are most concerned about. If a rare class is business-critical, macro F1 is usually the most honest metric. If you need an overall performance summary and the class mix in production is stable, micro F1 can be a better reflection of end-to-end correctness. If you need a compromise that still acknowledges imbalance, weighted F1 is often the most practical reporting choice.

A useful rule is to avoid using only one average when class imbalance is material. Report the per-class F1 scores alongside the chosen aggregate so you can see whether the headline number is masking a fragile minority class or a genuinely balanced model.

For practitioners working with policy-driven environments, zero trust principles help frame why average choice matters: the evaluation should match the trust boundary or control objective, not just a generic accuracy target. The NIST SP 800-207 Zero Trust Architecture guidance is a useful reference when the model’s decisions affect access, segmentation, or enforcement across unevenly sized classes.

Risk and Threat Considerations

Metric choice can hide failure modes if you pick the wrong average for the problem. In an imbalanced multiclass setting, a model that looks acceptable under micro F1 may still be missing the rare class that matters most, while weighted F1 can smooth over those misses if the majority classes are strong enough to dominate the score.

Failure mechanism: the evaluation objective and the chosen F1 average become misaligned, so the reported score rewards the wrong behaviour and masks poor performance on the class that actually matters.

Impact: teams may approve a model that performs well on average but fails on the exact category that drives risk, cost, or response quality, which can translate into avoidable operational errors and weak deployment decisions.

Practitioner Guidance

What to verify: check the per-class precision, recall, and F1 scores before trusting any single aggregate. If the minority class is materially important, treat a strong micro F1 as insufficient evidence on its own.

Decision rule: use macro F1 when every class deserves equal attention, micro F1 when the overall pool of predictions is the right lens, and weighted F1 when you need a prevalence-aware summary that still stays sensitive to imbalance.

Practitioner takeaway: the best metric is the one that matches the cost of the mistake, not the one that produces the most flattering headline.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 30, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org