covariate-shift · also input distribution shift

Covariate shift

Covariate shift is a change in the distribution of input features while the conditional distribution of the outcome given those features stays unchanged.

Related Observatory article: Read on hesela.com

For source P and target Q, covariate shift assumes P(Y | X) = Q(Y | X), while P(X) and Q(X) differ. Class prevalence can change too. This differs from label shift, which holds P(X | Y) fixed. [1] [2]

For a fixed predictor and integrable loss, target expected loss equals the source expectation of w(X) times loss, with w(x) = Q(x)/P(x), provided target feature support is covered by source support. A source-only average without these weights generally evaluates a different population. [1]

In a constructed two-stratum population, event probabilities stay 1/10 in A and 4/5 in B; the same rule alerts only on B. Changing the A:B mixture from 1:1 to 9:1 changes recall from 8/9 to 8/17 and false-positive rate from 2/11 to 2/83. Weights 9/5 for A and 1/5 for B recover the target confusion probabilities exactly. These are synthetic population probabilities, not observed disk counts. [3]

A change in device mix alone does not establish unchanged conditional failure risk. Keep features, event definition, horizon and prediction rule explicit. [2]

An exact iid sampling control draws two observations with replacement from that constructed source population. The expected weighted true-positive mean is 2/25 and the expected weighted positive mean is 17/100, whose ratio is the target recall 8/17. But expected sample weighted recall, conditional on a nonzero denominator, is 1208/1395. A zero-positive sample occurs with probability 121/400 and has undefined recall, not zero recall. The control enumerates all 16 ordered outcome sequences; it is not an observed sample or a general bias bound. [5]

Relations

related
Label shift

Limitations

  • No source reweighting can recover outcomes in a feature region with positive target probability but zero source probability. [1]
  • Large or estimated weights can make finite-sample estimates unstable; the population identity does not guarantee unbiased finite-sample recall ratios or validate the unchanged-conditional assumption. [1]

Citations

  1. Sugiyama, Krauledat and Mueller (2007). Covariate Shift Adaptation by Importance Weighted Cross Validation. JMLR 8:985-1005, sections 2.1-2.2 and 3, Lemma 1. (accessed 2026-11-23)
  2. Lipton, Wang and Smola (2018). Detecting and Correcting for Label Shift with Black Box Predictors. ICML, section 1: contrasting conditional assumptions. (accessed 2026-11-23)
  3. Hesela: exact synthetic covariate-shift confusion probabilities and importance weights; CC0 replay and tests. (accessed 2026-11-23)
  4. Hesela: exact enumeration showing a ratio of unbiased weighted means need not be unbiased; two iid draws from the synthetic example. (accessed 2026-11-23)

Further reading

  1. Hesela: cloud disk-error prediction and why feature-mixture changes do not establish rate transfer. (accessed 2026-11-23)
Sources & caveats
  • 2026-11-23: read Sugiyama et al. sections 2.1-2.2 and 3 for the invariant outcome conditional, finite known density-ratio assumption, risk identity and finite-sample variance limits.
  • 2026-11-23: read Lipton et al. section 1 to distinguish covariate from label shift. Device-mix and horizon cautions are storage-specific applications of those assumptions, not findings about Azure.
  • The two-stratum example is exact rational arithmetic independently checked by a separate read-only agent. It is not sampled data, a paper replication, a fleet estimate or an empirical uncertainty interval.
  • 2026-11-23: added an original finite-sample ratio control, checking 16 ordered sequences against an independent closed-form calculation. Zero denominators are reported explicitly; no empirical uncertainty or hardware conclusion is claimed.

JSON: /data/terms/covariate-shift.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Covariate shift. Hesela. 2026-11-23. https://hesela.dev/terms/covariate-shift/