Skip to content
Middle+0 views

Why did you use macro F1 rather than micro F1 or weighted F1?

Practice

AI answer

Macro F1 is the average F1 score across classes, without taking their sizes into account. It is suitable when the quality of recognizing every class matters, including rare ones, and the majority class must not be allowed to hide poor performance on the minority class. Micro F1 aggregates TP, FP, and FN across all classes, so under severe class imbalance it mainly reflects performance on the frequent class. Weighted F1 also averages F1 scores across classes, but weights them by the number of samples, so it may understate problems with a rare class. The choice depends on the task: if the cost of errors varies, I also look at per-class metrics, the confusion matrix, and business metrics.