Join our Newsletter — 33% off our NHI Course
Home› Glossary› AI Security› Macro F1
AI Security

Macro F1

← Back to Glossary
By NHI Mgmt Group Updated October 30, 2026 Domain: AI Security

Macro F1 calculates F1 for each class separately and then averages the class scores equally. It is useful when every class deserves the same attention, including rare ones. This makes it a better fit when minority-class failures matter as much as performance on the majority class.

How Macro F1 Is Calculated

macro F1 takes the f1 score for each class on its own, then averages those class scores with equal weight. It does not let a large majority class dominate the result, which is why it is often chosen when class balance is uneven and each class should count the same in the final metric.

That equal weighting is the key design choice. A model can look strong on a frequent class and still score poorly on minority classes, and macro F1 will surface that weakness more clearly than a weighted aggregate.

Why Macro F1 Is Used

Macro F1 is useful when the evaluation goal is fairness across classes rather than overall volume-weighted performance. It is especially helpful in classification problems where rare classes matter operationally, such as fraud patterns, abuse categories, safety incidents, or niche customer segments.

Because each class contributes one equal vote, the metric is better suited to decisions where missing a rare class is costly. It answers a different question from accuracy: not “how often was the model right overall?” but “how well did it perform on each class, including the hard ones?”

How Macro F1 Differs From Micro and Weighted F1

Macro F1 treats every class equally. Micro F1 pools all true positives, false positives, and false negatives before computing a single score, so frequent classes carry more influence. Weighted F1 sits between the two by averaging class F1 scores according to class support.

The practical difference is interpretive. If macro F1 is much lower than weighted or micro F1, the model is usually doing well on common classes while underperforming on rare ones. That gap is often a warning sign that the metric chosen for reporting does not match the risk profile of the task.

What Macro F1 Tells You In Practice

Macro F1 is best read as a balance metric across classes, not a stand-alone proof of model quality. It can be low even when the model appears useful in aggregate, because one or two weak classes can pull the average down sharply. That makes it valuable for model comparison, threshold tuning, and failure analysis.

It also has a built-in trade-off: because every class is weighted equally, it may penalise models that intentionally optimise for high-volume classes in production settings. For that reason, practitioners usually review macro F1 alongside per-class precision, recall, and support to understand where the model is helping and where it is failing.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0ID.AM-02 — Asset ManagementMacro F1 helps compare model performance across all classes in a classification asset map.
GV.OV-01 — Oversight of cybersecurity risk and performanceMacro F1 supports oversight by showing whether rare classes are being treated as first-class risk signals.
Recommendation — Use class-level metrics to monitor coverage across the full model input and output set. Track balanced class metrics when governance depends on minority-case detection quality.
CIS Controls v8CIS-8 — Audit Log ManagementMacro F1 is often used to judge detection quality across rare security classes, which depends on reliable event coverage.
Recommendation — Validate that detection logic performs consistently on low-frequency security events.

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