Macro Average
When you evaluate a classifier with more than two classes, you quickly run into a fairness question: should the “big” classes dominate the score, or should every class get an equal voice? Macro average is the option that gives each class the same weight, even if some classes are rare.
What macro averaging means
Macro average is an aggregation method for multi-class (or multi-label) metrics. You first compute a metric separately for each class (treating that class as “positive” vs. all others), then take the simple arithmetic mean across classes. For example, for precision:
- Compute precision for class A, class B, class C, …
- Average those per-class precisions with equal weight
The same idea applies to macro recall and macro F1. This differs from micro average, which pools all decisions first (so frequent classes contribute many more examples), and from weighted macro, which weights each class by its support (number of true instances).
Why it matters for imbalanced data
In imbalanced problems, a model can look great by doing well on the majority class while failing on minority classes. Macro averaging resists that: a terrible score on a rare class drags the macro score down just as much as a terrible score on a common class. That makes it a strong choice in settings like fraud detection, disease diagnosis, or churn prediction, where minority-class performance is often the whole point.
How you’ll see it in practice
- In scikit-learn:
f1_score(y_true, y_pred, average="macro"), similarly for precision/recall. - In a 3-class support-ticket classifier, macro F1 highlights whether “urgent” tickets are handled well, not just the abundant “normal” ones.
Macro average is an evaluation aggregation method for multi-class (or multi-label) problems that computes a metric (e.g., precision, recall, F1) independently for each class and then takes the unweighted mean across classes. It matters because it gives each class equal influence, making performance on minority classes visible and preventing majority classes from dominating the reported score in imbalanced datasets.
Imagine you’re judging a school with three classes: one huge class and two tiny ones. If you only look at the whole school average, the huge class can drown out how the small classes are doing. Macro average fixes that by giving each class equal say.
In AI classification (like sorting emails into “spam,” “promotions,” and “personal”), you often measure performance for each class separately (for example, how well “spam” is caught). A macro average takes those per-class scores and averages them so rare classes matter just as much as common ones, which is especially important when data is imbalanced.