Context. Every conformal guarantee rests on exchangeability of training and test points, and the most common way that fails is covariate shift: the test inputs come from a different while is unchanged. Ordinary split conformal then miscovers in either direction; on a tilted version of the airfoil data it covered 82% at a 90% target. This paper corrects distribution-free prediction intervals for covariate shift with a finite-sample guarantee, and in doing so finds the general condition behind conformal prediction. Given the unordered set of data points, exchangeability says each is equally likely to be the test point; under covariate shift the test point is point with probability proportional to . So the rank argument goes through with the uniform law replaced by these weights, and the test point's own weight is placed on , because its score is the one value the threshold may not use.
Setting. Training data , , and an independent test point , with and known up to a constant. A score treats the multiset as unordered, e.g. with fit symmetrically on . For trial let and . Quantiles are of distributions on , .
Lemma 1 and Theorem 1 (the unweighted case). If are exchangeable, then with upper bound when ties have probability zero, so the band of with covers with probability at least .
Corollary 1 (covariate shift). With the weights the band satisfies . For split conformal, with fit on independent data, this is , valid conditionally on the fitting data.
Theorem 2 (weighted exchangeability). are weighted exchangeable with weight functions if their joint density factors as with symmetric; independent draws with are an example, with . For such data the conformal band built with in place of , and the test point's weight on , has coverage at least . No upper bound is claimed.
A point mass at infinity stands in for the unknown test score. The threshold should not use the test score, and in the split case should not depend on at all. Raising the support points of a discrete distribution that lie above its quantile leaves that quantile unchanged, so and the right side says is among the smallest of exchangeable values, which has probability at least . The point at takes the place of the test score in the ranking, the same device as the inflated quantile in conformalized quantile regression.
Condition on the unordered sample, and exchangeability says which point is the test point. The paper reproves Lemma 1 in a form that generalizes. Condition on the event that the multiset of scores is ; permutation invariance of the density gives Given the multiset, is a uniform draw from it, so it falls below the quantile of that law with probability at least ; marginalize and apply Step 1. Exchangeability is used once, to compute the probability that each observed value is the test value.
Under weighted exchangeability that probability is the weight . Condition instead on the multiset of data points , so that the scores are fixed. With and symmetric, cancels: So , and Step 1 with the test point's weight moved to gives Theorem 2. The upper bound does not carry over: the largest jump of the conditional CDF is , which can be large, where in the unweighted case it is .
Under covariate shift the weights reduce to normalized likelihood ratios. The data are weighted exchangeable with for and . Only the last slot carries a weight, so each permutation's product is at the point it sends there, and the sum collapses to The normalizing constant of cancels, and the test weight is computable because is observed. That weight goes on : when the test point sits where training data are rare, is large, and once it exceeds the band is all of . The infinite band is how the method reports extrapolation, and the mass at cannot be dropped. In a small check of mine (not in the paper: , training , test , noise sd , absolute-residual scores, 90% target), the weighted band covered 97.3% and was infinite 40% of the time, unweighted split conformal covered 82.3%, and the weighted quantile with the test mass dropped and the training weights renormalized covered 81.6%, no better than ignoring the shift; at the three were 91.3%, 80.9% and 88.9%, with 0.5% infinite.
The airfoil experiment confirms the correction and shows its cost. The airfoil data (, ) were split into fitting, calibration and test parts over 5000 trials, and a shifted test set was drawn by an exponential tilt of two covariates. Unweighted split conformal covered 90.2% unshifted and 82.2% shifted; with the true weights the weighted band covered 90.8%, with coverage more dispersed across trials. The dispersion is the loss of effective sample size, : unweighted split conformal calibrated on only points reproduced it. In practice the ratio is estimated from unlabeled test covariates by a classifier of test against training points, whose odds are proportional to the density ratio; logistic regression and random forests both gave 91.0% average coverage, the forest with more variable intervals. The guarantee is proved for the true ; with estimated weights it is shown only empirically, on one low-dimensional dataset.
The same lemma applies beyond covariate shift. Any factorization that gives the law of which point is the test point gives weights. If only the law of a low-dimensional in shifts, the weight is , avoiding a density ratio in high-dimensional ; a second site that shares only covariates and the frequency of a binary attribute gets ; and kernel weights give locally averaged conditional coverage around one chosen center , rebuilt per center, consistent with the impossibility of exact conditional coverage.
Consequences and limits. Conformal validity rests on knowing the law of which point is the test point, with identical distributions as one case; any setting where that law can be computed gets finite-sample prediction intervals by the same rank argument, and later work on drift and nonexchangeable conformal prediction builds on this. The cost is a smaller effective sample size, and the band reports extrapolation as infinite width instead of hiding it. In credit, where the applicant mix shifts with marketing and approval cutoffs and default labels arrive months late, the method needs exactly what is available, current unlabeled applicants and old labeled ones, but only if default given the features is stable over that lag and a loosened cutoff has not admitted applicants outside the labeled population's support. It does not help when itself moves (concept shift, as when fraud adapts to the model) or under label shift. Limits: must be invariant and ; errors in an estimated ratio carry over to coverage; without an upper bound the bands can be very conservative when weights are uneven; and the guarantee is marginal over the test distribution.
Terms
- Covariate shift
- train , test ; only the input law changes
- likelihood ratio of test to training covariates; needed only up to a constant
- ; probability that point is the test point given the unordered sample
- Point mass at
- the test point's weight, placed on ; makes the threshold free of the unknown test score
- Quantile lemma
- quantile of iff quantile of
- Weighted exchangeability
- density with symmetric; includes independent non-identical draws
- No upper bound
- largest jump of the conditional CDF is , not
- Effective sample size
- ; explains the extra spread of weighted coverage
- Classifier weights
- from a test-versus-training classifier on unlabeled covariates
- Infinite band
- when , : the test point is where training data are sparse
Quiz
- The weighted method has no upper bound on coverage, unlike ordinary conformal. Why?Coverage overshoots the target by at most the largest atom of the conditional law of the test score, . With uneven weights that atom can be big, so coverage can sit well above .
- In a small simulation with , dropping the point mass at infinity and renormalizing the training weights covered about 82% at a 90% target. What went wrong?The guarantee comes from the test point's probability of being any of the points, including itself. Where is large that self-weight is large, and dropping it leaves a threshold set by the few training points near the test point, which undercovers.
- A credit model sees its applicant mix shift after a marketing change. Which condition decides whether weighted conformal restores coverage?The weights correct only the covariate law; the factorization needs the same in training and test. Unlabeled new applicants suffice to estimate , and the shift may be large at the cost of effective sample size.
Sources
- Ryan J. Tibshirani, Rina Foygel Barber, Emmanuel J. Candes, and Aaditya Ramdas. Conformal Prediction Under Covariate Shift. NeurIPS, 2019.