Homeglossary

Undersampling

Undersampling is a technique that deliberately uses fewer data points or signal samples for a technical purpose. In machine learning, it reduces examples from an overrepresented class, while in signal processing it samples a filtered high-frequency band below its usual Nyquist rate. The two uses share a name but require different safeguards against lost information and distortion.

Build balanced AI apps with Emergent.

What Is Undersampling?

Undersampling deliberately keeps fewer data points or signal samples for a technical purpose. In machine learning, it reduces examples from an overrepresented class. In digital signal processing, it samples a filtered high-frequency band at a lower rate. These separate uses require safeguards against losing useful information.

Undersampling in Machine Learning

Machine learning undersampling addresses imbalanced datasets, where a majority class greatly outnumbers a minority class. For example, a support-ticket model may see many routine requests but few urgent escalations. A model can appear accurate while missing rare cases. Undersampling reduces majority records so it can better learn minority-class patterns.

How Machine Learning Undersampling Works

Resampling must stay inside the training workflow.

  1. Split original data into training, validation, and test sets, preferably with stratified class proportions.
  2. Set a baseline using original training data and suitable metrics.
  3. Undersample only the training portion.
  4. Train on the resampled data.
  5. Evaluate on untouched data and compare with the baseline.

Sampling before the split can leak related records into evaluation data, making performance look better than it is.

Random Undersampling vs. Cleaning Methods

Simple subsampling is fast, while advanced methods try to retain useful majority examples.

MethodWhat it removesBest fit and main risk
Random undersamplingRandom majority recordsUseful for large datasets, but may discard important cases.
Prototype selectionRedundant majority examplesUseful when representatives preserve patterns, but may oversimplify them.
Neighborhood cleaningNoisy or ambiguous nearby recordsUseful near class boundaries, but can remove valid difficult examples.

Benefits of Undersampling

It is practical when the majority class is large and repetitive.

  • Reduces training time, storage use, and compute demand.
  • Makes minority-class signals more visible.
  • Simplifies experimentation with large datasets.
  • Helps prevent common records from dominating learning.

Limitations and Evaluation Safeguards

Undersampling trades data volume for balance, so validation is essential.

  • Removed records may contain patterns the deployed model needs.
  • Different random samples can produce different results.
  • The training ratio may not reflect real-world class prevalence.
  • Use precision, recall, F1 score, and precision-recall analysis, not accuracy alone.
  • Repeat experiments and retain untouched, stratified validation and test sets.

Undersampling vs. Oversampling

Both methods address class imbalance, but change training data differently.

ApproachHow it worksKey consideration
UndersamplingRemoves majority examplesEfficient, but loses information.
OversamplingDuplicates or synthesizes minority examplesRetains majority data, but may increase overfitting risk.
Class weightingPenalizes minority-class mistakes more heavilyOften a strong first test without changing records.

Keep resampling inside the training pipeline so evaluation remains realistic.

Bandpass Undersampling in Signal Processing

In signal processing, bandpass undersampling intentionally samples a properly filtered high-frequency band so it maps into a lower frequency range. This reduces sampling requirements in a controlled design. Unplanned undersampling causes aliasing, where frequencies overlap and distort the digital signal. It is not the same as balancing machine learning data.

Using Undersampling in AI Application Development

When building an AI-enabled product, define representative training data and test rare user outcomes before deployment. Teams can use app design and development practices to specify evaluation checks, then review related concepts in the Emergent glossary. Build balanced AI apps with Emergent.

Start Building
on Emergent today
Start Building