Knowledge Maxxing
← Back to topic library
ML MaxxingIntermediate75 sec

Class imbalance

Class imbalance occurs when one class in a classification dataset is far more common than another, which can bias a model toward always predicting the majority class.

Prerequisite: Accuracy

What matters

Standard accuracy becomes misleading under imbalance, since a model can score high just by favoring the majority class, so other metrics and techniques are needed to properly judge and address it.

Example

In a fraud dataset where only 1% of transactions are fraudulent, a model that always predicts 'not fraud' looks 99% accurate while catching zero fraud.

Common misconception

Class imbalance does not always need to be 'fixed'; the right approach depends on whether the minority class actually matters more for the task's real costs.

Recall question

Why does high accuracy become misleading on an imbalanced dataset?

Keywords and related concepts

class imbalanceminority classimbalanced dataresampling

Related topics

Resampling
ML MaxxingIntermediate
Classification threshold
ML MaxxingIntermediate
Accuracy
ML MaxxingBeginner