Robust Importance-Weighted Cross-Validation Under Sample Selection Bias

Wouter M. Kouw, Jesse H. Krijthe, Marco Loog

TL;DR

This paper tackles the challenge of selecting optimal model parameters when training data is collected from a different distribution than the target data (sample selection bias). They introduce a "control variate" technique to improve the robustness of importance-weighted cross-validation, making it more reliable in situations where the data distribution mismatch leads to extreme weights.

What Problem Does This Paper Address?

In machine learning, we often train models on data collected in a specific setting (e.g., a particular hospital, a specific time period) but want them to perform well on data from a broader, different distribution (e.g., a national population, future data). This mismatch is called "sample selection bias." A common way to handle this is "importance-weighting," where we re-weight the training data to make it look more like the target distribution. However, this method can fail spectacularly when the data distributions are very different, leading to extremely large weights for some samples. These large weights can cause the model selection process (like choosing the best regularization parameter) to become unstable and produce suboptimal results. This paper aims to make importance-weighted cross-validation more robust to these problematic large weights.

Methods

The core contribution of this paper is the introduction of a control variate to the importance-weighted risk estimator. A control variate is an auxiliary variable that is correlated with the quantity we want to estimate (in this case, the weighted loss) and whose expected value is known. By subtracting a scaled version of this control variate from the estimator, we can reduce its sampling variance.

Specifically, the authors propose using the importance weights themselves as the control variate. Since the expected value of the importance weights is always 1, they can be directly incorporated. The paper derives the optimal scaling factor for this control variate to minimize the variance of the risk estimator. They then apply this controlled importance-weighted risk estimator within a k-fold cross-validation framework to select hyperparameters.

Datasets

The authors evaluate their method on two types of datasets:

  • Synthetic Dataset: A controlled synthetic setting is created to precisely study the effect of varying degrees of sample selection bias. They generate data from a target distribution (unit bivariate normal) and a source distribution with a shifted mean and scaled covariance.
  • Ozone Level Detection Dataset: A real-world dataset from the UCI machine learning repository is used. This dataset involves predicting ozone days versus normal weather days based on weather station measurements. The source domain is simulated as a local sampling in time from this dataset.

Key Insights and Ideas

  • The Achilles' heel of Importance-Weighting: The paper clearly demonstrates that standard importance-weighting, while theoretically sound, can lead to significantly higher sampling variance and thus suboptimal hyperparameter selection when the source and target distributions diverge substantially.
  • Self-Correction with Control Variates: The ingenious idea is that the importance weights themselves, which cause the problem, can also be part of the solution. By using them as a control variate, we can actively reduce the variance they introduce.
  • Robustness is Key for Practicality: The paper emphasizes that for importance-weighting to be a truly practical tool for handling sample selection bias, it needs to be robust to situations with large weights. Their control variate approach directly addresses this.

Key Results

The paper presents empirical results showing that their proposed control variate significantly improves the robustness of importance-weighted cross-validation, especially in settings with problematic large weights (high variance in importance weights).

  • Synthetic Setting: When comparing the standard importance-weighted estimator (Rw) with their controlled version (Rβ), they observe that Rβ consistently yields lower mean target risks, particularly as the source variance (γ) decreases (indicating a larger distribution shift). The difference is statistically significant.
  • Ozone Dataset: Similar improvements are seen in the real-world ozone dataset. The controlled estimator Rβ is largely unaffected by large weights, producing consistent results, while the uncontrolled estimator Rw deteriorates.
  • Generalization: The authors also show that the effectiveness of the control variate is not tied to a specific weight estimation method, demonstrating similar improvements when using Kernel Mean Matching (KMM) and KLIEP as alternative weight estimators.

Limitations and Future Work

  • Additive Linear Control Variate: The paper focuses on an additive linear control variate. The authors suggest that more complex control variates (e.g., higher-order moments or multiplicative variates) might offer even larger reductions in variance if they have a stronger correlation with the weighted loss. However, searching for such optimal complex variates is an open challenge.
  • Estimation of β: While the theoretical derivation of β is presented, in practice, β needs to be estimated from data. The paper briefly mentions that this estimation can introduce a small bias, but further investigation into optimal estimation strategies might be beneficial.
  • Hyperparameter Tuning: The paper uses a specific range and number of steps for hyperparameter tuning. Exploring different tuning strategies or adaptive methods could be a future direction.

Summary updated

BibTeX
@inproceedings{kouw2019robust,
  author = {Wouter M. Kouw and Jesse H. Krijthe and Marco Loog},
  title = {{Robust Importance-Weighted Cross-Validation Under Sample Selection Bias}},
  booktitle = {MLSP},
  year = {2019},
  doi = {10.1109/mlsp.2019.8918731},
}
Figure