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.
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
- 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.
- Lipton, Wang and Smola (2018). Detecting and Correcting for Label Shift with Black Box Predictors. ICML, section 1: contrasting conditional assumptions.
- Hesela: exact synthetic covariate-shift confusion probabilities and importance weights; CC0 replay and tests.
- Hesela: exact enumeration showing a ratio of unbiased weighted means need not be unbiased; two iid draws from the synthetic example.
Further reading
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.