Effects of sampling skewness of the importance-weighted risk estimator on model selection

Wouter M. Kouw, Marco Loog · DOI

Abstract

Importance-weighting is a popular and well-researched technique for dealing with sample selection bias and covariate shift. It has desirable characteristics such as unbiasedness, consistency and low computational complexity. However, weighting can have a detrimental effect on an estimator as well. In this work, we empirically show that the sampling distribution of an importance-weighted estimator can be skewed. For sample selection bias settings, and for small sample sizes, the importance-weighted risk estimator produces overestimates for datasets in the body of the sampling distribution, i.e. the majority of cases, and large underestimates for data sets in the tail of the sampling distribution. These over- and underestimates of the risk lead to suboptimal regularization parameters when used for importance-weighted validation.

Introduction

In real-world machine learning, we often encounter covariate shift or sample selection bias—situations where the training data (source domain) does not perfectly represent the environment where the model will be deployed (target domain). Importance weighting is a standard technique used to correct for this domain shift by assigning higher weights to training samples that resemble target samples.

While importance weighting is mathematically celebrated as an unbiased estimator, this paper reveals a significant practical limitation: for small datasets, the risk estimator's sampling distribution is highly skewed. This means that although the estimator is unbiased in expectation (across infinite datasets), for any single small dataset, it is likely to be wildly inaccurate.

Methodology

The authors investigate this phenomenon through mathematical derivation and empirical simulation. They prove that multiplying a loss function by squared importance weights scales up the skewness of the distribution.

To visualize this, they generated a synthetic 1D dataset via rejection sampling to control domain shift precisely. The target domain follows a standard normal distribution $\mathcal{N}(0, 1^2)$, while the source domain is narrower, following $\mathcal{N}(0, 0.75^2)$.

Comparison of source and target domain distributions showing covariate shift.

The evaluation involved drawing 10,000 small datasets, calculating the importance-weighted risk for each, and observing how skewness affected the selection of the $L_2$-regularization parameter ($\lambda$) in a linear classifier with quadratic loss.

Analysis of Skewness

A key insight is that unbiasedness does not imply symmetry. The heavy right-skew (positive skew) observed in small samples means the probability mass is concentrated to the left of the true mean. Consequently, the majority of datasets (the "body") will yield an underestimate of the true risk. These frequent underestimates are mathematically balanced by a long, thin "tail" of rare, massive overestimates. While they cancel out in expectation, a practitioner's specific dataset is highly likely to fall within the body, leading to unreliable risk estimates.

Results

The empirical results demonstrate extreme skew at small sample sizes. For $N=2$, there were twice as many datasets in the body (underestimating risk) as in the tail. This skew directly impacts model selection: for $N=2$, datasets in the body overestimated the optimal regularization parameter ($\lambda$) by approximately +1.

Sampling distributions of the importance-weighted risk estimator for increasing sample sizes $N$.

As shown in the figure above, the skewness is fundamentally a small-sample problem. As the sample size ($N$) increases, the distribution becomes more symmetric and the skew diminishes. By $N \ge 32$ in this synthetic setup, the estimator becomes reliable, and the difference between body and tail estimates disappears, leading to accurate hyperparameter selection.

Discussion and Limitations

While the mathematical derivation suggests these findings apply broadly, the empirical study was limited to 1D Gaussian distributions. In higher-dimensional, real-world settings, the "curse of dimensionality" likely exacerbates this issue, requiring significantly more validation data to overcome the skew. Furthermore, the direction of the skew depends on the relative widths of the domains; if the source domain were wider than the target, the estimator would frequently overestimate the risk instead.

Summary updated

BibTeX
@inproceedings{kouw2018effects,
  author = {Wouter M. Kouw and Marco Loog},
  title = {{Effects of sampling skewness of the importance-weighted risk estimator on model selection}},
  booktitle = {ICPR},
  year = {2018},
  url = {https://openreview.net/forum?id=7rf07IQy4B6},
}
Figure