Estimating and Explaining Model Performance When Both Covariates and Labels Shift
Anonymous Author(s)
AffiliationAddress email
Abstract
Deployed machine learning (ML) models often encounter new user data that differsfrom their training data.
Therefore, estimating how well a given model mightperform on the new data is an important step toward reliable ML applications.
This is very challenging, however, as the data distribution can change in flexibleways, and we may not have any labels on the new data, which is often the casein monitoring settings.
In this paper, we propose a new distribution shift model,
Sparse Joint Shift (SJS), which considers the joint shift of both labels and a fewfeatures.
This unifies and generalizes several existing shift models including labelshift and sparse covariate shift, where only marginal feature or label distributionshifts are considered.
We describe mathematical conditions under which SJS isidentifiable.
We further propose SEES, an algorithmic framework to characterizethe distribution shift under SJS and to estimate a model’s performance on newdata without any labels.
We conduct extensive experiments on several real-worlddatasets with various ML models.
Across different datasets and distribution shifts,
SEES achieves significant (up to an order of magnitude) shift estimation errorimprovements over existing approaches.
Introduction
Deployed machine learning (ML) models often face new data different from their training data.
Forexample, mismatch of deployment-development data in geographical locations [20], demographicfeatures [15] and label balance [19] is widely observed and known to affect model performance.
Thus, estimating and explaining how a model’s performance changes on the new data is an importantstep toward reliable ML applications.
Estimating and explaining performance shift is challenging for several reasons, however.
One majorchallenge is that the data distribution might shift in flexible ways.
Another obstacle is that weoften do not have labels on the new data, especially in ML monitoring applications.
Without anyassumption on the distribution shift, it’s impossible to estimate how well the model would perform onthe unlabeled new data.
Previous work often assumes (i) label shift [21], where feature distributionsconditional on the labels are fixed, or (ii) covariate shift [30], where label distributions conditionalon features stay the same.
However, we often do not know whether the real data shift is limited tolabel or covariate shift, and naively applying estimation methods designed for one shift may produceinaccurate assessments [24].
Moreover, labels and features may shift simultaneously in practice,invalidating these common assumptions.
To tackle the above challenges, here we propose a new distribution shift model, Sparse Joint Shift(SJS), to consider the joint shift of both labels and a few features.
SJS assumes labels and a fewfeatures shift, but the remaining features’ distribution conditional on the shifted features and labelsis fixed.
This unifies and generalizes sparse covariate shift and label shift: both of them are SJS,
[Figure]
Labeled
[Figure]
SEES but some SJS is not label or sparse covariate shift (Figure 1).
We describe mathematical conditionsunder which SJS is provably identifiable: if the non-shifted features are weakly correlated, then themarginal feature distribution uniquely determines the joint distribution under SJS.
This makes itpossible to quantify the shift and estimate model performance on new data without any labels.
When SJS occurs: a motivating example.
Consider Alice, a data scientist who built an ML modelfor customer churn prediction.
Two years later, churn rate rose in some states but dropped in others,while the distribution of other features given label (churn) and location (state) remained.
This shift incustomer distribution is a natural SJS and challenging to estimate without labels on the new data.
Furthermore, we propose SEES, an algorithmic framework for performance shift estimation ande xplanation under SJS.
SEES exploits correlation shifts between features and labels modeled by SJSto improve performance estimation accuracy over existing methods, such as BBSE [21] for label shiftand KLIEP [30] for covariate shift (Figure 1).
It uses the identified shifted features and labels as anatural explanation of the performance shift.
We present an extensive empirical evaluation on realworld datasets with both simulated SJS and real shifts.
Our experiments validate the effectiveness of
SEES: the estimation error of SEES is often an order of magnitude smaller than that of previousstate-of-the-art methods.
All together, our contributions are :
We formulate and study sparse joint shift (SJS), a new distribution shift model that considers
the joint shift of both labels and features.
We show how it unifies and generalizes existing
shift models and when it is identifiable with unlabeled data.
We propose SEES, a general framework for performance shift estimation and explanation
under SJS.
We design efficient substantiations of SEES for different data types.
We provide comprehensive empirical analysis of our methods.
On real world datasets with
natural distribution shifts, we found SEES leads to up to 66% performance estimation error
reduction over standard approaches.
Related Work.
Label shift: Label shift has been observed and studied in various domains, such asepidemiologic [5], economics [22], and data mining [13].
Recently, there is an increasing interestin model evaluation and development under under label shift.
For example, [21, 3] study how toquantify label shift and evaluate an ML model’s performance under label shift accordingly.
[38] givesan algorithm for active learning under label shift.
Online adaptation to label shift [35] is also shownto be feasible.
Label shift can be viewed as a subset of our proposed shift model SJS.
Althoughsimpler and easier to estimate, label shift does not capture the joint shift of labels and features.
Thus,methods developed for label shift may not work well under SJS.
Covariate shift: Covariate shift [28, 36, 23] is perhaps the most widely adopted assumption in datadistribution shift.
Since studied in the seminal work [28], various methods have been proposed toestimate covariate shift, including KLIEP [31], KMM [14], and IWCV [29].
Adaptation to covaraiteshift has been found useful in many applications, such as spam filtering [4], emotion recognition [18]and human activity detection [17].
More recently, covariate shift adaptation is jointly optimized withmodel robustness [27], fairness [26], and conformal prediction [33].
Unsupervised model performance evaluation : Model performance evaluation without labels hasreceived relatively limited attention.
Domain-specific models’ performance can be estimated viacertain statistics, such as confidence score [16], rotation prediction [9] and feature statistics of thedatasets sampled from a meta-dataset [10] for image recognition.
General model evaluation oftenrelies on different assumptions and accessibility.
[7] assumes covariate shift and requires users toprovide an approximation (slice) of the shifted features, while [6] needs white-box access to the MLmodels to train an ensemble as a reference.
[12] assumes the label distributions are known, while[8] needs a feature independence structure given the labels.
When a small number of labels can beobtained, [34] proposes an active model evaluation approach.
To our knowledge, this is the first paperthat explicitly models the joint shift of both labels and a few features with provable identificationguarantees.
Moreover, we do not require access to side information such as model design or metadata.
Preliminaries and Problem Statement
We start by giving the preliminaries and the problem of estimating and explaining performance shift.
Prediction tasks and ML models.
In this paper we consider the standard classification task: givena d -dimensional feature vector xxx ∈ X ⊆ R d from the feature space X , the goal is to predict itsassociated label y ∈ Y in the label space Y .
Let f ( · ) :
R d (cid:55)→ Y denote an ML model designed forsuch a task.
For simplicity, we assume that Y
= { 1 , 2 , · · · , L } .
Given the model’s prediction f
( xxx )and its true label y , its performance is quantified by some loss function ℓ ( · , · ) .
A popular choice isthe standard 0-1 loss: ℓ ( a, b ) = 1 a = b , which we focus on, but other losses are also applicable.
Joint distribution shift.
The training and inference data for ML often come from two differentdistributions, referred to as source domain and target domain.
Here, we consider the general casewhen the joint distribution vary across the source and target domains, and call this joint distributionshift .
Formally, let P s , P t : X × Y (cid:55)→ [0 , 1] denote the source and target domains, and p s , p t be theirprobability density (or mass) functions.
Then joint distribution shift means p s ( xxx, y )
̸
= p t ( xxx, y ) .
Problem statement.
Suppose we are given a labeled dataset D s ≜ { ( xxx s,i , y s,i ) }
n s i =1 from thesource distribution P s , an unlabeled dataset D t ≜ { ( xxx t,i ) } n t i =1 from the target distribution P t , and an
ML model f ( · ) predicting the associated label given any feature vector xxx .
Our goal is to estimatehow much performance changes from the source domain to the target domain.
More formally, weaim at estimating the performance shift ∆ ≜ E ( xxx,y ) ∼ P t [ ℓ ( f ( xxx ) , y )] − E ( xxx,y ) ∼ P s [ ℓ ( f ( xxx ) , y )] .
This ischallenging as we do not observe labels on the target domain.
In many applications, attributing theperformance shift to certain features is also desired.
Thus, we are also interested in identifying a setof features to explain the performance shift.
SJS: A Tractable Unification of Label Shift and Sparse Covariate Shift
At a first glance, estimating the performance shift under joint distribution shift without observinglabels from target domain seems hopeless: if the marginal feature distributions are identical for bothdomains, then observing the features alone should give 0 as the estimated performance shift.
However,the label distribution given any feature on the target domain is arbitrary, and thus the estimated shiftcan be arbitrarily bad.
In other words, joint distribution shift is not identifiable with no target labels.
To mitigate nonidentifiability, it’s necessary to make additional assumptions.
The most popularassumptions in literature are label shift [21] and covariate shift [28].
Label shift assumes that onlylabel distribution may change, but the feature distribution given a label remains, i.e., p s ( xxx | y ) =
p t ( xxx | y ) .
On the other hand, covariate shift assumes that feature distribution can shift, but the labeldistribution given the features is fixed, i.e., p s ( y | xxx ) =
p t ( y | xxx ) .
However, those assumptions disallow simultaneous changes of both features and labels, which often happen in real-world data [20, 25, 32].
To enable joint feature and label estimation which is tractable, we introduce a subclass of jointdistribution shift, Sparse Joint Shift (SJS), as follows.
Definition 1 (Sparse Joint Shift (SJS)) .
Suppose for some integer s ≤ d and an index set I ⊂ [ d ]with size at most s ( |I| ≤ s ), p s ( xxx I c | xxx I , y )
=
p t ( xxx I c | xxx I , y ) .
Then we say the source and target pair( p s , p t ) is under s -Sparse Joint Shift, or s - SJS .
Here, I c ≜ [ d ] − I .
We call I the shift index set.
Roughly speaking, SJS allows both labels and a few features to shift, but assumes the remainingfeatures’ conditional distribution to stay the same.
Next, we will study when this assumption allowstractable performance shift estimation.
All proofs are left to the appendix.
3.1 When is sparse joint shift identifiable?
Recall that additional assumptions are needed because the general joint distribution shift is notidentifiable.
However, when s = d , s -SJS simply becomes general joint distribution shift.
Thus, it isworthy understanding when s -SJS resolves the identifiability issue.
To do so, let us first formallyintroduce the notation of identifiability.
Definition 2 (Identifiable) .
Suppose the source-target tuple ( p s , p t ) is under s - SJS .
( p s , p t ) isidentifiable
if and only if for any alternative distribution p a ( x x x, Y ) , if p a ( x x x ) =
p t ( x x x ) and ∃J ⊂[ d ] , |J | ≤ s , such that p a ( xxx J c | xxx J , y )
=
p s ( xxx J c |
xxx J , y ) , then p a ( xxx, y ) =
p t ( xxx, y ) .
The identifiability can be easily interpreted in words: If a joint feature and label distribution matchesthe target feature distribution and satisfies the s -SJS requirement together with the source distribution,it has to be the target distribution.
The following statement shows when ( p s , p t ) is identifiable.
Theorem 1.
Suppose ( p s , p t ) is under s - SJS .
Assume for any set J ⊂ [ d ] , |J | ≤ s and any fixed¯ xxx ∈ X , the probability density (or mass) functions { p s ( xxx J c ∩I c ,xxx J∪I =
¯ xxx J∪I ,
y = i ) }
Li =1 arelinearly independent.
Then ( p s , p t ) is identifiable.
This statement sheds light on why uniquely identifying the target distribution without target label isfeasible under sparse joint shift.
Roughly speaking, s -SJS requires that given the shifted features andlabels, the remaining features’ distribution remains the same on both domains.
If those remainingfeatures are different enough (linear independence), they can uniquely determine the distribution ofthe shifted features and labels.
We stress that the linear independence is necessary: if it does not hold,then for any s , we can always find some source-target pair ( p s , p t ) which is not identifiable.
Linearindependence implicitly requires sparsity: if s > d/ 2 , then J c ∩ I c can be empty and the linearindependence does not hold.
In other words, the sparsity is necessary for the shift to be identifiable.
3.2 How does SJS relate to label shift and covariate shift?
A natural question is how does SJS relates to standard label shift and covariate shift.
The followingstatement formally gives the answer.
Theorem 2.
If ( p s , p t ) is under label shift, then it is also under 0 - SJS .
If ( p s , p t ) is under sparsecovariate shift, i.e., p s ( xxx I c | xxx I ) =
p t ( xxx I c | xxx I ) for some index set I with size s < d , then it is alsounder s - SJS .
In addition, there exists ( p s , p t ) under s - SJS such that it is under neither label shift orcovariate shift.
There are several takeaways.
First, label shift implies SJS without additional requirements.
In fact,as certain distribution pairs are under SJS but not label shift, SJS is strictly more general than labelshift.
Second, SJS also includes sparse covariate shift.
When s = d , SJS completely unifies bothlabel shift and covariate shift, though it is not identifiable.
Identifiable SJS, on the other hand, unifieslabel shift and sparse covariate shift.
Finally, SJS also allows shifts not covered by label shift andcovaraite shift: the correlation between label and (a set of) features can be shifted.
Shift Estimation and Explanation under Sparse Joint Shift
Now we present SEES, an algorithmic framework to estimate and explain the performance shift∆ when the source and target domain is under s -SJS.
As shown in Figure 2, it consists of threecomponents: a sparsity-aware density matcher, an empirical gap calculator, and a shifted feature [Figure]
selector. Given the labeled source samples and unlabeled target samples, we first adopt the sparsityaware density matcher to obtain an estimated ratio of the target and source density functions, denotedby ˆ w ( xxx, y ) .
Next, the empirical gap calculator is responsible to estimate the performance shift ∆via appropriately reweighting source samples with ratio ˆ w ( xxx, y ) .
Finally, the shifted feature selectorpicks a set of features as the explanation for the shift.
We explain each component as follows.
4.1 Sparsity-aware density matcher
A key component of SEES is the sparsity-aware density matcher.
Here we want to find some weightfunction ˆ w ( xxx, y ) to induce an estimated target distribution ˆ p t ( xxx, y ) ≜ ˆ w ( xxx, y ) · p s ( xxx, y ) .
Our goalsinclude (i) a small distance between the estimated target distribution and the true target distribution,(ii) s -SJS between the source and the estimated target distributions, and (iii) flexible parameterizationof the weight function.
To achieve those goals, we propose the following optimization framework
[Equation]
y )
[Equation]
w [Equation] xxx, y ) depends on at most s features of xxx
[Equation]
Here, D ( · , · ) is some distance metric that measures the difference between two density functions.
We minimize the distance between the induced feature density ˆ p t ( xxx ) and the target feature densityp t ( xxx ) .
The minimization is not over joint label and feature distributions since target labels are notavailable.
The induced feature density function can be easily derived from source density functionand the weight function, encoded in the first constraint.
s -SJS is enforced by the second constraint:s -SJS means given s features and labels, the distributions of remaining features are fixed acrosssource and the induced domain, which holds if and only if their density ratio w ( xxx, y ) only depends onthose s features.
W represents the set of all feasible weight functions.
Different parameterization canbe easily realized by adopting different W .
Assume access to density functions p s ( xxx, y ) and p t ( xxx ) ,and a weight function set W containing the true weight w ∗ ( xxx, y ) ≜
p t ( xxx,y ) p s ( xxx,y ) .
One can easily show theabove optimization returns the true weight function w ∗ ( xxx, y ) for identifiable s -SJS.
One benefit of the above framework is the flexibility of concrete instantiations.
Different designchoices, including the distance metric D ( · , · ) and the weight parameterization space W , can fit different feature types, incorporate domain knowledge, and tradeoff different sample and computationalcomplexity.
We give two instantiations of the above optimization: SEES-c for continuous features,and SEES-d for discrete features.
SEES-c: SEES for continuous features.
For continuous features, we use KL-divergence D KL ( · , · )as the distance metric, and initialize the parameterization space W by linear combinations of Kfixed basis functions, ϕ 1 ( x x x, y ) , ϕ 2 ( x x x, y ) , · · · , ϕ K ( x x x, y ) .
That is to say, W = { w ( x x x, y ) | w ( x x x, y ) =(cid:80) Kk =1 a k,y ϕ k
( xxx, y ) , a k,y ≥ 0 , E ( xxx,y ) ∼ P s (cid:104)(cid:80)
Kk =1 a k,y ϕ k
( xxx, y ) (cid:105) = 1 , α k,y ≥ 0 } .
The last two constraints ensure w ( xxx, y ) · p s ( xxx, y ) is a valid probability density.
Those basis functions encode users’prior knowledge about the shift.
A simple choice, for example, is linear functions: setting K = dand ϕ k
( xxx, y ) =
xxx k .
To model the dependence on different features, let e i denote all indexes k such that ϕ k ( · ) depends on feature
xxx i , and introduce a vector βββ ∈ R d such that βββ i ≜ (cid:113)(cid:80) k ∈
[Equation]
Ly =1 a 2 k,y
[Equation]
The feature dependence requirement in Problem 4.1 is equivalent to sparsity constraint ∥ βββ ∥ 0 ≤ s .
We can relax the 0 -norm by 1 -norm and obtain one instantiation of Problem 4.1 as
[Equation]
where η > 0 controls the trade-off between sparsity and the KL distance.
One benefit of thisinstantiation is computational efficiency: the constraint is linear in the optimization variables, and theobjective is convex.
Thus, the problem is convex and can be efficiently solved.
The label distributiongiven feature p s ( y | xxx ) is unknown but can be approximated by the ML model f ( · ) trained on thesource domain.
Given finite samples, the expectations can be replaced by their empirical estimation.
SEES-d: SEES for discrete features.
Another interesting instantiation exists for discrete features.
With no prior knowledge, we parameterize W to include all possible s -SJS: specifically, W containsall tuple ( J, w J ( xxx J , y )) , where index set J ⊂
[ d ] , | J | = s represents the shifted features, and weightfunction w J
( xxx J , y ) only depends on xxx J and y .
Features only take finite values, so we can view the density (mass) functions as vectors with finitedimensions.
Thus, we adopt the squared ℓ 2 distance, i.e., D ( zzz,zzz ′ ) =
(cid:80) | zzz | i =
( zzz i − zzz ′ i ) 2 to measuredistance.
However, naively measuring ℓ 2 distance between p t ( xxx ) and ˆ p t ( xxx ) leads to a computationalcomplexity exponential in d .
Instead, we measure the distance on a set of marginal densities: givenan index set J , for every index set with size 2 s that contains J , denoted by κ , we measure the squaredℓ 2 distance between p t ( xxx κ , f ( xxx )) and ˆ p t ( xxx κ , f ( xxx )) , and then aggregate over κ .
This design leads tothe following instantiation of Problem 4.
[Equation]
where p s (¯ xxx κ , ¯ f ) and p t (¯ xxx κ , ¯ f, ¯ y ) are short for p s ( xxx κ = ¯ xxx κ , f ( xxx )
=
¯ f ) and p t ( xxx κ = ¯ xxx κ , f ( xxx ) =
¯ f, y = ¯ y ) , respectively.
Compared to the naive approach, the above formulation is much more computationally efficient: thenumber of parameters in the above objective is only polynomial in the feature dimension d .
For fixed
J , the problem is simply a linear regression over the weight w J ( xxx J , y ) and thus can be efficientlysolved.
In practice, one can estimate p s (¯ xxx κ , ¯ f ) and p t (¯ xxx κ , ¯ f, ¯ y ) via labeled source and unlabeledtarget samples, and then solve the empirical version of the above problem.
Compared to using
KL-divergence, solving the empirical version produces the correct shifted index set and a weightfunction close to the true weight w ∗ ( xxx, y )
(under mild conditions).
This is formally stated as follows.
Theorem 3.
Consider when all features are discrete, i.e., for each i , xxx i ∈ { 1 , 2 , · · · , v } .
Suppose (i)the source and target are under exact s - SJS , (ii) for any set J ⊂ [ d ] , |J | ≤ s and any ¯ xxx ∈ X , themarginal probability density (or mass) functions { p s ( f ( xxx ) ,xxx J∪I =
¯ xxx J∪I ,
y = i ) } di =1 are linearlyindependent, and (iii) w ( xxx, y ) is bounded by a constant M .
Then there exists some constant c (independent of d, n s and n t ), such that if (cid:113) 12 n s + LM (cid:113) 12 n t <
c/ (cid:112) 2 s log d
+ s log v + 2 log L + log 1 /δ ,then with probability 1 − δ , (i) the index set ˆ J learned by Problem 4.2 matches the trueshift index set I , and (ii) the produced weights w ˆ J ( xxx ˆ J , y ) satisfies (cid:12)(cid:12)
w ˆ J ( xxx ˆ J , y ) − w ∗ xxx, y ) (cid:12)(cid:12) ≤
O (cid:16) (cid:112) 2 s log d
+ s log v + 2 log L + log 1 /δ (cid:16)(cid:113) 12 n s + LM (cid:113) 12 n t (cid:17)(cid:17) .
Roughly speaking, this statement ensures that, when source and target sample sizes are large enough,with high probability, the true shift index set can be identified with finite samples, and the error rateof the learned weight function is approximately the inverse of sample sizes’ square root.
Comparisons of SEES-c and SEES-d.
SEES-d enjoys mathematical guarantees, but SEES-c canbe computationally more efficient.
In practice, we can discretize continuous features to use SEES-d.
4.2 Empirical gap calculator and shifted feature selector
Now we explain how the other two compoents of SEES work.
The empirical gap calculator computes the performance shift ˆ∆ via three steps.
First, it estimates the source performance by 1 n s (cid:80) n s i =1 ℓ ( xxx s,i , y s,i ) .
Next, it estimates the performance on the induced target distribution.
Note that the performance on the induced target domain is (cid:82) ˆ p t ( xxx, y ) ℓ ( xxx, y ) dxxxdy = 245 (cid:82) ˆ w ( xxx, y )
p s ( xxx, y ) ℓ ( xxx, y ) dxxxdy =
E ( xxx,y ) ∼ P s [ ˆ w ( x, y ) ℓ ( xxx, y )] .
Thus, we use the weighted loss on thesource samples 1 n s (cid:80) n s i =1 ˆ w ( xxx s,i , y s,i ) ℓ
xxx s,i , y s,i ) as the estimation.
Finally, their difference, i.e.,ˆ∆ = 1 n s (cid:80) n s i =
1 ( ˆ w ( xxx s,i , y s,i ) − 1) ℓ ( xxx s,i , y s,i ) is returned as the estimated performance shift.
The shifted feature selector picks a set of features as the shift explanation.
For discrete data, theweight function ˆ w ( xxx, y ) learned by the density matcher’s instantiation is parameterised as a shiftedindex ˆ J and the corresponding weight ˆ w ˆ J ( xxx ˆ J , y ) .
Thus, a natural choice is to return ˆ I =
ˆ J asthe explanation.
For continuous data, the weight function is ˆ w ( xxx, y )
=
(cid:80)
Kk
=
ˆ a k,y ϕ k
( xxx, y ) , whereˆ a k,y is learned by the corresponding instantiation.
Recall that e i denotes all basis functions thatdepends on feature i .
Then ˆ βββ i ≜ (cid:113)(cid:80)
k ∈
e i (cid:80)
Ly =1 a 2 k,y can be viewed as the total contribution offeature i .
Thus, a simple choice is to pick features with the s largest contributions.
Formally, we useˆ I
=
{ i | ˆ βββ i > ˆ βββ ( d − s ) } , where ˆ βββ ( d − s ) is the d − s smallest value in ˆ βββ .
Experiments
In this section, we study the performance of SEES on several real world datasets with synthetic andnatural distribution shifts.
Our goal is four-fold: (i) understand when and how SEES estimates theperformance shift, (ii) evaluate the trade-offs between the estimation performance reached by SEESand the required dataset sizes, (iii) explore the effects of shift sparsity on SEES’ performance, and(iv) validate the effectiveness of SEES on datasets with real world distribution shifts.
Datasets, ML models and baselines.
Six datasets are used for evaluation purposes.
we firstsimulate various SJS on BANKCHURN [1], COVID-19 [2], and CREDIT [37] to systematicallyunderstand the performance of SEES.
Next, we apply SEES on EMPLOY, INCOME, and INSURANCE [11] with real world distribution shifts and perform an in-depth analysis.
We use a gradientboosting tree model as the ML model, and results for more models can be found in the Appendix.
For comparison, we adopt two state-of-the-art methods for comparison: BBSE [21] for label shiftand KLIEP [30] for covariate shift.
More details on the experiments can be found in the Appendix.
Case study.
We start with a case study on the dataset COVID-19.
The task is to predict whethera person tests positive for COVID-19.
We simulate a joint shift of the feature aged and label.
Specifically, both source and target data contain 5000 young and aged individuals.
The positive rateis 40% for both young and aged group from the source.
In the target data, we raise the positive rate to80% for aged group and 50% for young group.
This simulates a shift due to a COVID variant moreharmful to the elder than its ancestor.
We adopt SEES-d as all features are categorical.
Figure 3 summarizes this case study.
First note that identifying which feature is shifted is not obvious.
As shown in Figure 3(a), the marginal distribution of most features except age and gender has changedfrom the source to the target.
The actual joint shift (Figure 3(b)) is, on the other hand, due to agegroup and the labels.
Identifying shifted age is challenging as the label on the target (last red barin Figure 3(a)) also shifts but cannot be observed.
On the other hand, SEES-d correctly identifiesthe shifted feature age, and produces a weight function close to the true weight (Figure 3(b) and(c)).
This is primarily because SEES-d explicitly exploits the joint shift modeled by SJS.
In fact,
SEES-d’s performance is significantly better than existing methods.
As shown in Figure 3(d), themean square error (MSE) between the true weights and learned weights is only 0.002 when adopting SEES-d, but 0.144 and 0.573 when using BBSE and KLIEP, respectively. The Pearson correlationcoefficient (PCC) between the true weights and weights learned by SEES-d is 0.996, indicating astrong correlation. The weight estimation performance directly affects how precise the estimated
[Figure]
𝑤 ∗ (𝒙,𝑦) =
𝐼 = {𝒂𝒈𝒆} 𝐼 = {𝒂𝒈𝒆} 𝑤(𝒙,𝑦) =
Method
MSE
PCC
Est Gap
True Gap
SEES-d 0.002 0.
15.5 BBSE 0.
KLIEP 0.
[Figure]
accuracy gap is.
The estimated gap ˆ∆ of SEES-d is 16.7%, which is close to the true gap (15.5%).
By contrast, BBSE tends to overestimates the gap (26.3$) while KLIEP underestimates it (1.58%).
Trade-offs between estimation performance and sample size.
Next, we study the trade-offsbetween estimation performance and the number of available samples.
For simplicity, we simulatevarious sparse joint shifts with s = 1 via (i) specifying marginal distribution of the shifted featureand labels first, and (ii) then drawing random samples from the original dataset conditional on valuesof specified labels and shifted feature.
Same number of samples are allocated to both source andtarget datasets.
Figure 4 shows the simulated data shift (column 1), the squared ℓ 2 loss of accuracyestimation (column 2), weight estimation (column 3), and the shifted feature discovery rate (column4) for three datasets.
Overall, we observe that the estimation error of SEES-c and SEES-d diminishesas the number of samples increases, while that of BBSE and KLIEP is almost flat.
This is becausse
BBSE and KLIEP ignore the change of correlation between features and labels.
In addition, SEES-c
SEES-d can often identify the shifted feature correctly given large number of samples, while BBSEand KLIEP cannot.
Interestingly, while no theoretical guarantee is known for SEES-d, its estimationperformance often matches or even surpasses the instantiation designed for discrete data.
[Table]
Effects of shift sparsity.
We have focused on 1 -SJS for simplicity, but how the sparsity s affectsthe estimation performance remains unknown.
To answer this, we fix the number of samples to be10,000, and then measure the performance of all compared methods for joint distribution of labeland different number of features.
Overall, we observe that the estimation error often grows as morefeatures shift jointly with the labels.
This is because more shifted features often implies highercomplexity in the distribution shifts and thus more parameters to estimate.
It is worthy noting that0 -SJS degenerates to label shift, and the performance of SEES-c and SEES-d is slightly worse
[Figure]
Overall, both SEES-c and SEES-d consistently outperforms existing estimation approaches than BBSE (designed for label shift) under 0 -SJS.
This is a trade-off for covering more generaldistribution shifts.
More details can be found in the appendix.
Accuracy gap estimation on real shifts.
Finally we validate the effectiveness of SEES on accuracyestimation with real world shifts.
EMPLOY and INCOME are partitioned by geography (states) and
INSURANCE is partitioned by time (year).
For each partition pair, we train a gradient boostingmodel on one and estimate its performance on the other.
Table 1 shows the estimation error averagedover all partition pairs for each dataset.
SEES consistently outperforms BBSE and KLIEP, andreduces the estimation error by up to 66% (1-1.7/5.0).
We also evaluate other models (including aneural network) and observe similar results.
More results can be found in the Appendix.
Conclusion
In this paper, we propose Sparse Joint Shift (SJS), a new distribution shift model that accounts for bothlabel and covariate shifts.
We show how SJS unifies and generalizes existing distribution shift modelsand remains identifiable under reasonable assumptions.
We develop SEES, an algorithmic frameworkfor unsupervised model performance estimation and explanation under SJS.
Both theoretical analysisand empirical study validates the effectiveness of SEES.
Our work contributes to making ML morereliable when data can change.
A natural next step is how to improve estimation performance under
SJS when a small number of target labels can be queried.
This paper focuses on model performanceestimation and explanation.
Developing ML models robust to different SJS is also an open question.
Checklist
For all authors...
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s
contributions and scope?
[Yes]
(b) Did you describe the limitations of your work?
[Yes] .
See Appendix A.
(c) Did you discuss any potential negative societal impacts of your work?
[Yes] .
SeeAppendix A.(d)
Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] .
If you are including theoretical results...
(a) Did you state the full set of assumptions of all theoretical results?
[Yes] .
(b) Did you include complete proofs of all theoretical results?
[Yes] .See
Appendix B3.
If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main experi- mental results (either in the supplemental material or as a URL)?
[Yes]
(b) Did you specify all the training details (e
g., data splits, hyperparameters, how theywere chosen)?
[Yes] .
Please see Appendix C.
(c) Did you report error bars (e
g., with respect to the random seed after running experiments multiple times)?
[Yes]
(d) Did you include the total amount of compute and the type of resources used (e
g., typeof GPUs, internal cluster, or cloud provider)?
[Yes] .
Please see Appendix C.
If you are using existing assets (e
g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators?
[Yes] .
(b) Did you mention the license of the assets?
[N/A]
(c) Did you include any new assets either in the supplemental material or as a URL?
[N/A]
(d) Did you discuss whether and how consent was obtained from people whose data you’re
using/curating?
[N/A]
(e) Did you discuss whether the data you are using/curating contains personally identifiable
information or offensive content?
[N/A]
If you used crowdsourcing or conducted research with human subjects...
(a) Did you include the full text of instructions given to participants and screenshots, if
applicable?
[N/A] .
(b) Did you describe any potential participant risks, with links to Institutional Review
Board (IRB) approvals, if applicable?
[N/A] .
(c) Did you include the estimated hourly wage paid to participants and the total amount
spent on participant compensation?
[N/A] .