Average performance across unequal groups

Type each count alongside the label that gives it meaning. · 209 words

Accuracy is the share of predictions that are correct. When groups have different sizes, there are two useful ways to average their results. Suppose a museum app predicts whether visitors want an audio tour. It gets 90 of 90 visitors in Group A correct, giving 100 percent group accuracy. It gets 6 of 10 visitors in Group B correct, giving 60 percent. The pooled accuracy across all 100 visitors is (90 + 6) / 100 = 96 percent. This is a weighted average because the large group has more influence. The macro-average instead gives each group equal weight: (100 + 60) / 2 = 80 percent.

The difference becomes clearer if Group B contains 30 visitors rather than 10, while still getting 60 percent correct. Group A still contains 90 visitors with 100 percent accuracy. Pooled accuracy is then (90 + 18) / 120 = 90 percent, but the macro-average remains (100 + 60) / 2 = 80 percent. Changing a group's size did not change its performance, yet it changed the overall average because pooled accuracy weights groups by their number of cases. A fair report should show group-level results and both averages, especially when one group may receive less training data or be affected more by errors.

Check your recall

Why does the model have 80 percent macro-average accuracy but 90 percent pooled accuracy in the second scenario?

Check your answer

The macro-average gives Group A and Group B equal weight, so it is (100 + 60) / 2 = 80 percent. The pooled average weights groups by size, and the larger, perfectly classified Group A pulls the result up to 90 percent.

Sources and credits

Original KeyTouch lesson. Background reading · Google · Classification metrics.