Skip to content
Machine Learning

What is downsampling in the context of class-imbalanced dataset?

Training on a disproportionately low percentage of over-represented class examples in order to improve model training on under-represented classes.

datasciencetrivia.com

Card 1 of 259. Answer: Training on a disproportionately low percentage of over-represented class examples in order to improve model training on under-represented classes.

Created by santiviquez

About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.

The longer answer

Downsampling, or undersampling, means training on only a fraction of the majority-class examples so the minority class makes up a larger share of the training set. If fraud is 1% of transactions, keeping every fraud but one legitimate transaction in ten puts more positives in each batch, so easy negatives stop dominating the loss.

With 1,000 frauds and 99,000 legitimate rows, keeping 10% of the legitimate ones leaves 1,000 against 9,900, about 9% positive. The catch: the model now overestimates fraud. With keep rate β = 0.1, a sample probability p maps back to β·p / (β·p + 1 − p), so 0.5 means about 0.09. A common fix is to upweight each kept negative by 10 in the loss.

The cost is discarded data, which hurts when the majority class is varied or the dataset small; oversampling, SMOTE or class weights keep every row. Resample only the training split: validation and test sets must keep the real class ratio, or precision will look better than it will in production.

All questions