Optimal downsampling for Imbalanced Classification with Generalized Linear Models

Yan Chen, Jose Blanchet, Krzysztof Dembczynski, Laura Fee Nern, Aaron Eliasib Flores

Abstract

Downsampling or under-sampling is a technique that is utilized in the context of large and highly imbalanced classification models. We study optimal downsampling for imbalanced classification using generalized linear models (GLMs). We propose a pseudo maximum likelihood estimator and study its asymptotic normality in the context of increasingly imbalanced populations relative to an increasingly large sample size. We provide theoretical guarantees for the introduced estimator. Additionally, we compute the optimal downsampling rate using a criterion that balances statistical accuracy and computational efficiency. Our numerical experiments, conducted on both synthetic and empirical data, further validate our theoretical results, and demonstrate that the introduced estimator outperforms commonly available alternatives.

Introduction

In domains such as digital advertising, fraud detection, and healthcare, datasets are frequently characterized by extreme class imbalance. For instance, conversion rates in online ads may be lower than 0.1% across billions of impressions. Training models on such massive, imbalanced datasets is computationally prohibitive.

The standard industry practice is downsampling (or under-sampling), where all rare "positive" events are retained while only a small fraction ($\alpha$) of the common "negative" events are sampled. However, this process introduces bias and raises a critical question: how can one determine the optimal sampling rate $\alpha$ that balances computational speed with statistical accuracy? While previous research focused primarily on logistic regression, this work generalizes the solution to the entire family of Generalized Linear Models (GLMs).

Methodology: The Pseudo MLE and Efficiency Cost

The authors employ a "rare-event" asymptotic regime, modeling the probability of a positive event as $\mathbb{P}(Y=1|X=x) = 1 - F(\tau_n + \theta^T x)$. Here, $\tau_n$ increases with the dataset size $n$, representing an increasingly rare positive class.

A core contribution is the Pseudo Maximum Likelihood Estimator (Pseudo MLE). Unlike standard inverse-weighting methods that simply re-weight samples, the Pseudo MLE directly incorporates the downsampling rate into the log-likelihood function. The authors prove that this estimator is consistent and asymptotically normal.

To determine the optimal sampling rate, the researchers adapted the Glynn and Whitt (1992) framework to define an "efficiency cost." This metric multiplies the statistical variance by the computational cost. By minimizing this product, they derive a closed-form formula for the optimal downsampling rate ($\alpha^*$).

Efficiency cost vs. alpha for various imbalance levels ($\tau_n$).

Experimental Validation

The approach was validated using both synthetic simulations and real-world benchmark datasets from the UCI Machine Learning Repository, including abalone_19 (130:1 ratio), mammography (42:1), and yeast_me2 (28:1).

Key Results and Insights

Numerical experiments confirmed that when $\alpha$ is chosen within the theoretically derived "proper" range, the mean squared error (MSE) of the Pseudo MLE is nearly identical to that of a model trained on the full dataset. This suggests a "free lunch" in downsampling: in rare-event regimes, a significant portion of negative samples can be discarded without losing predictive power.

Mean Squared Error (MSE) comparison between Pseudo-MLE and inverse-weighting.

Furthermore, the Pseudo MLE consistently achieved lower log-loss on test data compared to commonly used inverse-weighting estimators. The proposed estimator also proved more robust; while simple rescaling or inverse-weighting can lead to biased predictions, the Pseudo MLE handles bias correction intrinsically during optimization.

Conclusion and Future Work

This research provides a principled framework for downsampling in GLMs, offering clear guidance on calculating the "sweet spot" for $\alpha$ analytically. While the Pseudo MLE is optimized for "rare event" setups, its principles were successfully extended to 3-layer neural networks, outperforming standard cross-entropy.

Future work will explore how optimal sampling rates vary for other metrics, such as AM-risk or F-measure, and investigate applying similar rigorous asymptotic analysis to oversampling techniques like SMOTE.

Summary updated

BibTeX
@inproceedings{chen2025optimal,
  author = {Yan Chen and Jose Blanchet and Krzysztof Dembczynski and Laura Fee Nern and Aaron Eliasib Flores},
  title = {{Optimal downsampling for Imbalanced Classification with Generalized Linear Models}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=ZleVCnq1tS},
}
Figure