Macro-F1
A method to aggregate F1 Score across multiple classes: F1 is calculated for each class separately, then the arithmetic mean is taken. All classes are equal, even if one of them is rare.
Difference from Micro-F1
| Macro-F1 | Micro-F1 | |
|---|---|---|
| Class weights | Equal | By number of examples |
| Rare classes | Heard | Drowned |
| When to use | All classes are important | Overall picture is important |
Example
Three classes with F1 = 0.9, 0.5, 0.1. Macro-F1 = (0.9 + 0.5 + 0.1) / 3 = 0.5. Micro-F1 would have calculated based on total TP/FP/FN, and rare classes would have had little impact.