Skip to content

Oversampling

Balancing technique for the dataset: rare classes are copied or generated additionally so that the model does not ignore them.

The Imbalance Problem

If the dataset contains 99% examples of class 'A' and 1% of class 'B', the model may simply always predict 'A' — achieving 99% accuracy formally. However, it will not learn class 'B'.

How Oversampling Works

  • Duplication — rare examples are copied;
  • Augmentation — variations of rare examples are created;
  • Synthetic — generation of new similar examples.

Opposite — undersampling

Undersampling removes part of frequent examples to balance the classes. Both methods solve the same problem but from different sides.

See also

← All terms