What is class imbalance?

Definition

A dataset is imbalanced when its categories have substantially different frequencies. This can influence the patterns a classifier learns and how its performance should be measured, especially when the uncommon category is important.

Overall accuracy can hide poor results on rare cases. Evaluators should examine errors by category and use measures suited to the application's needs. Sampling and training adjustments can help, but their effects must be checked on representative test data.

ELI5

An imbalanced collection contains many examples of one group and very few of another. A system can look successful by repeatedly choosing the common group, even if it misses the cases you care most about.

For example, imagine 100 documents with only five relevant to a question. Calling every document irrelevant would be right 95 times, but it would fail to find any of the five useful documents.

Why can accuracy be misleading with imbalanced data?

Correctly predicting the common category can dominate the score while errors on the rare category stay hidden.

Does class imbalance always make a dataset unusable?

No. It calls for suitable training choices and evaluation that clearly measures performance on each important category.

  1. Blue and white headline 'LOCAL AI DECISIONS' beside a blue node branching to three white circles, on black.
Definition card for class imbalance: What is class imbalance?

Class imbalance occurs when some categories appear much more often than others in the data used to train or evaluate an AI classifier.