Doubly Robust Counterfactual Classification
Abstract
We study counterfactual classification as a new tool for decision-making under hypothetical (contrary to fact) scenarios.
We propose a doubly-robust nonparametric estimator for a general counterfactual classifier, where we can incorporate flexible constraints by casting the classification problem as a nonlinear mathematical program involving counterfactuals.
We go on to analyze the rates of convergence of the estimator and provide a closed-form expression for its asymptotic distribution.
Our analysis shows that the proposed estimator is robust against nuisance model misspecification, and can attain fast √ n rates with tractable inference even when using nonparametric machine learning approaches.
We study the empirical performance of our methods by simulation and apply them for recidivism risk prediction.
Introduction
Counterfactual or potential outcomes are often used to describe how an individual would respond to a specific treatment or event, irrespective of whether the event actually takes place.
Counterfactual outcomes are commonly used for causal inference, where we are interested in measuring the effect of a treatment on an outcome variable [14, 15, 45].
Recently, counterfactual outcomes have also been proved to be useful for predicting outcomes under hypothetical interventions.
This is commonly referred to as counterfactual prediction .
Counterfactual prediction can be particularly useful to inform decision-making in clinical practice.
For example, in order for physicians to make effective treatment decisions, they often need to predict risk scores assuming no treatment is given; if a patient’s risk is relatively low, then she or he may not need treatment.
However, when a treatments is initiated after baseline, simply operationalizing the hypothetical treatment as another baseline predictor will rarely give the correct (counterfactual) risk estimates because of confounding [58].
Counterfactual prediction can be also helpful when we want our prediction model developed in one setting to yield predictions successfully transportable to other settings with different treatment patterns.
Suppose that we develop our risk prediction model in a setting where most patients have access to an effective (post-baseline) treatment.
However, if we deploy our factual prediction model in a new setting in which few individuals have access to the treatment, our model is likely to fail in the sense that it may not be able to accurately identify high-risk individuals.
Counterfactual prediction may allow us to achieve more robust model performance compared to factual prediction, even when model deployment influences behaviors that affect risk.
[see, e.g., 9, 26, 54, for more examples].
However, the problem of counterfactual prediction brings challenges that do not arise in typical prediction problems because the data needed to build the predictive models are inherently not fully observable.
Surprisingly, while the development of modern prediction modeling has greatly enriched the counterfactual-outcome-based causal inference particularly via semi-parametric methods [19, 22], the use of causal inference to improve prediction modeling has received far less attention [see, e.g., 9, 46, for a discussion on the subject].
In this work, we study counterfactual classification, a special case of counterfactual prediction where the outcome is discrete.
Our approach allows investigators to flexibly incorporate various constraints into the models, not only to enhance their predictive performance but also to accommodate a wide range of practical and ethical constraints relevant to their classification tasks [e.g., fairness criteria, 13, 33].
Counterfactual classification poses both theoretical and practical challenges, as a result of the fact that in our setting, even without any constraints, the estimand is not expressible as a closed form functional unlike typical causal inference problems.
We tackle this problem by framing counterfactual classification as a special case of nonlinear stochastic programming with counterfactual components.
1.1 Related Work
Our work lies at the intersection of causal inference and stochastic optimization.
Counterfactual prediction is closely related to estimation of the conditional average treatment effect (CATE) in causal inference, which plays a crucial role in precision medicine and individualized policy.
Let Y a denote the counterfactual outcome that would have been observed under treatment or intervention
A
= a , A ∈ { 0 , 1 } .
The CATE for subjects with covariate X = x is defined as τ ( x ) =
E [ Y 1 − Y 0 | X = x ] .
There exists a vast literature on estimating CATE.
These include some important early works assuming that τ ( x ) follows some known parametric form [e.g., 44, 52, 55].
But more recently, there has been an effort to leverage flexible nonparametric machine learning methods [e.g., 1, 3, 21, 24, 28, 30, 39, 57].
A desirable property commonly held in the above CATE estimation methods is that the function τ ( x ) may be more structured and simple than its component main effect function
E
[ Y a | X = x ] .
In counterfactual prediction, however, we are fundamentally interested in predicting Y a conditional on X
= x under a “single" hypothetical intervention
A = a , as opposed to the contrast of the conditional mean outcomes under two (or more) interventions as in CATE.
Counterfactual prediction is often useful to support decision-making on its own.
There are settings where estimating the contrast effect or relative risk is less relevant than understanding what may happen if a subject was given a certain intervention.
As mentioned previously, this is particularly the case in clinical research when predicting risk in relation to treatment started after baseline [9, 26, 46, 54].
Moreover, in the context of multi-valued treatments, it can be more useful to estimate each individual conditional mean potential outcome separately than to estimate all the possible combinations of relative effects.
With no constraints, under appropriate identification assumptions (e.g., (C1)-(C3) in Section 2), counterfactual prediction is equivalent to estimating a standard regression function
E
[ Y | X, A
= a ] so in principle one could use any regression estimator.
This direct modeling or plug-in approach has been used for counterfactual prediction in randomized controlled trials [e.g., 25, 38] or as a component of CATE estimation methods [e.g., 3, 28].
An issue arises when we are estimating a projection of this function onto a finite-dimensional model, or where we instead want to estimate E
[ Y a | V ] =
E { E [ Y | X, A = a ] | V } for some smaller subset V ⊂ X (e.g., under runtime confounding [8]), which renders the plug-in approach suboptimal.
Moreover, the resulting estimator fails to have double robustness, a highly desirable property which provides an additional layer of robustness against model misspecification [4].
On the other hand, we often want to incorporate various constraints into our predictive models.
Such constraints are often used for flexible penalization [17] or supplying prior information [12] to enhance model performance and interpretability.
They can also be used to mitigate algorithmic biases [6, 13, 33].
Further, depending on the scientific question, practitioners occasionally have some constraints they wish to place on their prediction tasks, such as targeting specific sub-populations, respecting budget constraints, or accounting for the compositional nature of the data [18, 27, 37].
In the plug-in approach, however, it is not clear how to incorporate the given constraints into the modeling process.
In our approach, we directly formulate and solve an optimization problem that minimizes counterfactual classification risk, where we can flexibly incorporate various forms of constraints.
Optimization problem involving counterfactuals or counterfactual optimization , in particular asymptotic behavior of its optimal solutions, has not been extensively studied, with very few exceptions in causal inference [e.g., 23, 29, 32, 33].
Our results are closest to [32] and [23], which study counterfactual optimization in a class of quadratic and nonlinear programming problems, respectively, yet this approach i) is not applicable to classification where the risk is defined with respect to the cross-entropy, and ii) considers only linear constraints.
Similarly as in [23], we tackle the problem of counterfactual classification from the perspective of stochastic programming.
Two most common approaches in stochastic programming are stochastic approximation (SA) and sample average approximation (SAA)
[e.g., 35, 50].
However, since i) we cannot compute sample moments or stochastic subgradients that involve unobserved counterfactuals, and ii) the SA and SAA approaches cannot harness efficient estimators for counterfactual components, e.g., doubly-robust or semiparametric estimators with cross-fitting [7, 36], more general approaches beyond the standard SA and SAA settings should be considered [e.g., 47–49] at the expense of stronger assumptions on behavior of the optimal solution and its estimator.
1.2 Contribution
We study counterfactual classification as a new decision-making tool under hypothetical (contrary to fact) scenarios.
Based on the semiparametric theory for causal inference, we propose a doubly-robust, nonparametric estimator that can incorporate flexible constraints into the modeling process.
Then we go on to analyze rates of convergence and provide a closed-form expression for the asymptotic distribution of our estimator.
Our analysis shows that the proposed estimator can attain fast √ n rates even when its nuisance components are estimated using nonparametric machine learning tools with much slower rates.
We study the finite-sample performance of our estimator via simulation and provide a case based on real data.
Importantly, our algorithm and analysis are applicable to other problems in which the estimand is given by the solutions to a general nonlinear optimization problem whose objective function involves counterfactuals, where closed-form solutions are not available.
Problem and Setup
Suppose that we have access to an i.i.d.
sample ( Z 1 , ..., Z n ) of n tuples Z =
( Y, A, X ) ∼ P for some distribution P , binary outcome Y ∈ { 0 , 1 } , covariates X ∈ X ⊂ R d x , and binary intervention
A ∈ A = { 0 , 1 } .
For simplicity, we assume A and Y are binary, but in principle they can be multi-valued.
We consider a general setting where only a subset of covariates V ⊆
X can be used for predicting the counterfactual outcome Y a .
This allows for runtime confounding , where factors used by decision-makers are recorded in the training data but are not available for prediction (see [8] and references therein).
We are concerned with the following constrained optimization problem minimize
[Equation]
subject to
[Equation]
for some compact subset B ∈ R k , known C 2 -functions g j : B → R , σ : B × R k ′
→ (0 , 1) , and the index set J = { 1 , ..., m } for the inequality constraints.
Here, σ is the score function and b ( V ) =
[ b 1 ( V ) , ..., b k ′ ( V )] ⊤ represents a set of basis functions for V (e.g., truncated power series, kernel or spline basis functions, etc.).
Note that we do not need to have k = k ′ ; for example, depending on the modeling techniques, it is possible to have a much larger number of model parameters than the number of basis functions, i.e., k > k ′ .
L ( Y a , σ ( β, b ( V ))) is our classification risk based on the cross-entropy.
S consists of deterministic inequality constraints 1 and can be used to pursue a variety of practical purposes described in Section 1.
Let β ∗ denote an optimal solution in ( P ).
β ∗ is our optimal model parameters (coefficients) that minimize the counterfactual classification risk under the given constraints.
Classification risk and score function.
Our classification risk L ( Y a , σ ( β, b ( V ))) is defined by the expected cross entropy loss between Y a and σ ( β, b ( V )) .
In order to estimate β ∗ , we first need to estimate this classification risk.
Since it involves counterfactuals, the classification risk cannot be identified from observed data unless certain assumptions hold, which will be discussed shortly.
The form of the score function σ ( β, b ( V )) depends on the specific classification technique we are using.
Our default choice for σ is the sigmoid function with k = k ′ , which makes the classification risk strictly convex with respect to β .
It should be noted, however, that more complex and flexible classification techniques (e.g., neural networks) can also be used without affecting the subsequent results, as long as they satisfy the required regularity assumptions discussed later in Section 4.
Importantly, our approach is nonparametric; β ∗ is the parameter of the best linear classifier with the sigmoid score in the expanded feature space spanned by b ( V ) , but we should never assume a ‘log-linear’ relationship between Y a and b ( V ) as in ordinary logistic regression models.
Identification.
To estimate the counterfactual quantity L ( Y a , σ ( β, b ( V ))) from the observed sample ( Z 1 , ..., Z n ) , it must be expressed in terms of the observational data distribution P .
This can be accomplished via the following standard causal assumptions [e.g., 16, Chapter 12]:
• (C1) Consistency :
Y
=
Y a if A = a • (C2)
No unmeasured confounding : A ⊥⊥ Y a | X • (C3)
Positivity : P ( A = a | X ) >
a.s.
(C1) - (C3) will be assumed throughout this paper.
Under these assumptions, our classification risk is identified as
[Equation]
where we let L ( β ) ≡ L ( Y a , σ ( β, b ( V ))) .
Since we use the sigmoid function with an equal number of model parameters as basis functions, for clarity, hereafter we write σ ( β ⊤ b ( V ))
=
σ ( β, b ( V )) .
It is worth noting that even though we develop the estimator under the above set of causal assumptions, one may extend our methods to other identification strategies and settings (e.g., those of instrumental variables and mediation), since our approach is based on the analysis of a stochastic programming problem with generic estimated objective functions (see Appendix B).
Notation.
Here we specify the basic notation used throughout the paper.
For a real-valued vector v , let ∥ v ∥ 2 denote its Euclidean or L 2 -norm.
Let P n denote the empirical measure over ( Z 1 , ..., Z n ) .
Given a sample operator
h
(e.g., an estimated function), let P denote the conditional expectation over a new independent observation Z , as in P ( h )
=
P { h ( Z ) } = (cid:82) h ( z ) d P ( z ) .
Use ∥ h ∥ 2 , P to denote the L 2 ( P ) norm of h , defined by ∥ h ∥ 2 , P = (cid:2) P ( h 2 ) (cid:3) 12 = (cid:2)(cid:82) h ( z ) 2 d P ( z ) (cid:3) 12 .
Finally, let s ∗ ( P ) denote the set of optimal solutions of an optimization program P , i.e., β ∗ ∈ s ∗ ( P ) , and define dist ( x, S )
= inf {∥ x − y ∥ 2 : y ∈ S } to denote the distance from a point x to a set S .
Estimation Algorithm
Since ( P ) is not directly solvable, we need to find an approximating program of the “true" program ( P ).
To this end, we shall first discuss the problem of obtaining estimates for the identified classification risk (1).
To simplify notation, we first introduce the following nuisance functions
[Equation]
and let (cid:98) π a and (cid:98) µ a be their corresponding estimators.
π a and µ a are referred to as the propensity score and outcome regression function, respectively.
A natural estimator for (1) is given by
[Equation]
where we simply plug in the regression estimates (cid:98) µ a into the empirical average of (1).
Here, we construct a more efficient estimator based on the semiparametric approach in causal inference [20, 22].
Let
[Equation]
denote the uncentered efficient influence function for the parameter E { E [ Y | X, A
= a ] } , where a set of the nuisance functions is defined by η = { π a ( X ) , µ a ( X ) } .
Then it can be deduced that for an arbitrary fixed real-valued function h : X → R , the uncentered efficient influence function for the parameter ψ a :=
E { E [ Y | X, A = a ] h ( X ) } is given by φ a ( Z ; η ) h ( X ) (Lemma A.1 in the appendix).
Now we provide an influence-function-based semiparametric estimator for ψ a .
Following [7, 21, 43, 59], we propose to use sample splitting to allow for arbitrarily complex nuisance estimators (cid:98) η .
Specifically, we split the data into K disjoint groups, each with size of n/K approximately, by drawing variables ( B 1 , ..., B n ) independent of the data, with B i =
b indicating that subject i was split into group b ∈ { 1 , ..., K } .
Then the semiparametric estimator for ψ a based on the efficient influence function and sample splitting is given by
[Equation]
where we let P bn denote empirical averages over the set of units { i : B i = b } in the group b and let (cid:98) η − B K denote the nuisance estimator constructed only using those units {
i : B i ̸ = b } .
Under weak regularity conditions, this semiparametric estimator attains the efficiency bound with the double robustness property, and allows us to employ nonparametric machine learning methods while achieving the √ n -rate of convergence and valid inference under weak conditions (see Lemma A. in the appendix for the formal statement).
If one is willing to rely on appropriate empirical process conditions (e.g., Donsker-type or low entropy conditions [53]), then η can be estimated on the same sample without sample splitting.
However, this would limit the flexibility of the nuisance estimators.
The classification risk L ( β ) is a sum of two functionals, each of which is in the form of ψ a , Thus, for each β , we propose to estimate the classification risk using (3) as follows
[Equation]
Now that we have proposed the efficient method to estimate the counterfactual component L ( β ) , in what follows we provide an approximating program for ( P ) which we aim to actually solve by substituting (cid:98) L ( β ) for L ( β ) minimize β ∈B (cid:98) L ( β ) subject to β ∈ S .
( (cid:98) P )
Let (cid:98) β ∈
s ∗ ( (cid:98) P ) .
Then (cid:98) β is our estimator for β ∗ .
We summarize our algorithm detailing how to compute the estimator (cid:98) β in Algorithm 1.
( (cid:98) P ) is a smooth nonlinear optimization problem whose objective function depends on data.
Unfortunately, unlike ( P ), ( (cid:98) P ) is not guaranteed to be convex in finite samples even if S is convex.
Non-convex problems are usually more difficult than convex ones due to high variance and slow computing time.
Nonetheless, substantial progress has been made recently [5, 42], and a number of efficient global optimization algorithms are available in open-source libraries (e.g., NL OPT ).
Also in order for more flexible implementation, one may adapt neural networks for our approach without the need for specifying σ and b ; we discuss this in more detail in Section 6 as a promising future direction.
Asymptotic Analysis
This section is devoted to analyzing the rates of convergence and asymptotic distribution for the estimated optimal solution (cid:98) β .
Unlike stochastic optimization, analysis of the statistical properties of optimal solutions to a counterfactual optimization problem appears much more sparse. In what was perhaps the first study of the problem, [23] analyzed asymptotic behavior of optimal solutions for a particular class of nonlinear counterfactual optimization problems that can be cast into a parametric program with finite-dimensional stochastic parameters.
However, the true program ( P ) does not belong to the class to which their analysis is applicable.
Here, we derive the asymptotic properties of (cid:98) β by considering similar assumptions as in [23]. We first introduce the following assumptions for our counterfactual component estimator (cid:98) L .
1 input: b ( · ) , K 2 Draw ( B 1 , ..., B n ) with B i ∈ { 1 , ..., K } 3 for b = 1 , ..., K do
Let D
= { Z i : B i ̸ =
b } and D 1 =
{ Z i : B i = b }
Obtain (cid:98) η − b by constructing (cid:98) π a , (cid:98) µ a on D
M 1 ,b ( β ) ← empirical average of φ a ( Z ; (cid:98) η − b ) log σ ( β ⊤ b ( V )) over D
M 0 ,b ( β ) ← empirical average of (1 − φ a ( Z ; (cid:98) η − b )) log(1 − σ ( β ⊤ b ( V ))) over D8 (cid:98) L ( β ) ← (cid:80) Kb
=1 (cid:8) 1 n (cid:80) ni
=1 1 ( B i = b ) (cid:9) ( M 1 ,b ( β ) + M 0 ,b ( β )) 9 solve ( (cid:98) P ) with (cid:98) L ( β ) (A1) P ( (cid:98) π a ∈ [ ϵ, 1 − ϵ ]) = 1 for some ϵ >(A2) ∥ (cid:98) µ a − µ a ∥ 2 , P =
o P (1) or ∥ (cid:98) π a − π a ∥ 2 , P =
o P (1) (A3) ∥ (cid:98) π a − π a ∥ 2 , P ∥ (cid:98) µ a − µ a ∥ 2 , P =
o P ( n − 12 ) Assumptions (A1) - (A3) are commonly used in semiparametric estimation in the causal inference literature [19]. Next, for a feasible point ¯ β ∈ S we define the active index set. Definition 4.1 (Active set) .
For ¯ β ∈ S , we define the active index set J 0 by
[Equation]
¯ β ) = 0 } .
Then we introduce the following technical condition on g j .
[Equation]
B1)
For each β ∗ ∈ s ∗ ( P )
[Equation]
Assumption (B1) holds, for example, if each g j is locally convex around β ∗ .
In what follows, based on the result of [47], we characterize the rates of convergence for (cid:98) β in terms of the nuisance estimation error under relatively weak conditions.
Theorem 4.1 (Rate of Convergence) .
Assume that (A1), (A2), and (B1), hold.
Then
[Equation]
Hence, if we further assume the nonparametric condition (A3), we obtain
[Equation]
Theorem 4.1 indicates that double robustness is possible for our estimator, and thereby √ n rates are attainable even when each of the nuisance regression functions is estimated flexibly at much slower rates (e.g., n − 1 / 4 rates for each), with a wide variety of modern nonparametric tools.
Since L is continuously differentiable with bounded derivative, the consistency of the optimal value naturally follows by the result of Theorem 4.1 and the continuous mapping theorem.
More specifically, in the following corollary, we show that the same rates are attained for the optimal value under identical conditions.
Corollary 4.1 (Rate of Convergence for Optimal Value) .
Suppose (A1), (A2), (A3), (B1) hold and let v ∗ and (cid:98) v be the optimal values corresponding to β ∗ ∈ s ∗ ( P ) and (cid:98) β , respectively.
Then we have | (cid:98) v − v ∗ | =
[Equation]
In order to conduct statistical inference, it is also desirable to characterize the asymptotic distribution of (cid:98) β .
This requires stronger assumptions and a more specialized analysis [47].
Asymptotic properties of optimal solutions in stochastic programming are typically studied based on the generalization of the delta method for directionally differentiable mappings [e.g., 48–50].
Asymptotic normality is of particular interest since without asymptotic normality, consistency of the bootstrap is no longer guaranteed for the solution estimators [11].
We start with additional definitions of some popular regularity conditions with respect to ( P ).
Definition 4.2 (LICQ) .
Linear independence constraint qualification (LICQ) is satisfied at ¯ β ∈ S if the vectors ∇ β g j (¯ β ) , j ∈ J 0 (¯ β ) are linearly independent.
Definition 4.3 (SC) .
Let L ( β, γ ) be the Lagrangian.
Strict Complementarity (SC) is satisfied at ¯ β ∈ S
if, with multipliers ¯ γ j ≥ 0 , j ∈ J
(¯ β ) , the Karush-Kuhn-Tucker (KKT) condition
[Equation]
is satisfied such that ¯ γ j > 0 , ∀ j ∈ J 0 (¯ β ) .
LICQ is arguably one of the most widely-used constraint qualifications that admit the first-order necessary conditions.
SC means that if the j -th inequality constraint is active, then the corresponding dual variable is strictly positive, so exactly one of them is zero for each 1 ≤ j ≤ m .
SC is widely used in the optimization literature, particularly in the context of parametric optimization [e.g., 50, 51].
We further require uniqueness of the optimal solution in ( P ).
(B2) Program ( P ) has a unique optimal solution β ∗ (i.e., s ∗ ( P ) ≡ { β ∗ } is singleton).
Note that under (B2) if LICQ holds at β ∗ , then the corresponding multipliers are determined uniquely [56].
In the next theorem, we provide a closed-form expression for the asymptotic distribution of (cid:98) β .
Theorem 4.2 (Asymptotic Distribution) .
Assume that (A1) - (A3), (B1), and (B2) hold, and that
LICQ and SC hold at β ∗ with the corresponding multipliers γ ∗ .
Then
[Equation]
for some k × | J 0 ( β ∗ )
| matrix B and random variable Υ such that
[Equation]
where
[Equation]
The above theorem gives explicit conditions under which (cid:98) β is √ n -consistent and asymptotically normal.
We harness the classical results of [48] that use an expansion of (cid:98) β in terms of an auxiliary parametric program.
To show asymptotic normality of (cid:98) β , linearity of the directional derivative of optimal solutions in the parametric program is required.
We have accomplished this based on an appropriate form of the implicit function theorem [10].
This is in contrast to [32] that relied on the structure of the smooth, closed-form solution estimator that enables direct use of the delta method.
Lastly, our results in this section can be extended to a more general constrained nonlinear optimization problem where the objective function involves counterfactuals (see Lemmas B.1, B.2 in the appendix).
Simulation and Case Study 5.1 Simulation
We explore the finite sample properties of our estimators in the simulated dataset where we aim to empirically demonstrate the double-robustness property described in Section 3.
Our data generation process is as follows:
[Equation]
− X 1 + 0 .
5 X 2 − 0 .
25 X 3 − 0 .
1 X 4 + 0 .
X 5 + 0 .
05 X 6 ) ,
Y =
{+A 1 { X 1 + 2 X 2 − 2 X 3 − X 4 + X 5 + ε > 0 } + (1 − A ) 
+}
{+{ X 1 + 2 X 2 − 2 X 3 − X 
+}
+ X 6 + ε < 0 } , ε ∼ N (0 , 1) .
Our classification target is Y 1 .
For b ( X ) , we use X , X 2 and their pairwise products.
We assume that we have box constraints for our solution: | β ∗ j | ≤ 1 , j = 1 , ..., k .
Since there exist no other natural baselines, we compare our methods to the plug-in method where we use (2) for our approximating program (cid:98) P .
For nuisance estimation we use the cross-validation-based Super Learner ensemble via the S UPER L EARNER R package to combine generalized additive models, multivariate adaptive regression splines, and random forests.
We use sample splitting as described in Algorithm 1 with
K = 2 splits.
We further consider two versions of each of our estimators, based on the correct and distorted X , where the distorted values are only used to estimate the outcome regression µ a .
The distortion is caused by a transformation X (cid:55)→ ( X 1 X 3 X 6 , X 22 , X 4 / (1 + exp( X 5 )) , exp( X 5 / 2)) .
To solve (cid:98) P , we first use the StoGo algorithm [40] via the NLOPTR R package as it has shown the best performance in terms of accuracy in the survey study of [34].
After running the StoGo, we then use the global optimum as a starting point for the BOBYQA local optimization algorithm [41] to further polish the optimum to a greater accuracy.
We use sample sizes n = 1 k, 2 .
5 k, 5 k, 7 . 5 k, 10 k and repeat the simulation 100 times for each n .
Then we compute the average of | v ∗ − (cid:98) v | and ∥ β ∗ − (cid:98) β
∥ 2 .
Using the estimated counterfactual predictor, we also compute the classification error on an independent sample with the equal sample size.
Standard error bars are presented around each point.
The results with the correct and distorted X are presented in Figures 1 and 2, respectively.
With the correct X , it appears that the proposed estimator performs as well or slightly better than the plug-in methods.
However, in Figure 2 when (cid:98) µ a is constructed based on the distorted X , the proposed estimator gives substantially smaller errors in general and improves better with n .
This is indicative of the fact that the proposed estimator has the doubly-robust, second-order multiplicative bias, thus supporting our theoretical results in Section 4. [Table]
5.2 Case Study: COMPAS Dataset
Next we apply our method for recidivism risk prediction using the Correctional Offender Management
Profiling for Alternative Sanctions (COMPAS) dataset 2 .
This dataset was originally designed to assess the COMPAS recidivism risk scores, and has been utilized for studying machine bias in the context of algorithmic fairness [2].
More recently, the dataset has been reanalyzed in the framework of counterfactual outcomes [31–33].
Here, we focus purely on predictive purpose.
We let A represent pretrial release, with A = 0 if defendants are released and A = 1 if they are incarcerated, following methodology suggested by [33].
3 We aim to classify the binary counterfactual outcome Y 0 that indicates whether a defendant is rearrested within two years, should the defendant be released pretrial.
We use the dataset for two-year recidivism records with five covariates: age, sex, number of prior arrests, charge degree, and race.
We consider three racial groups: Black, White, and Hispanic.
We split the data ( n = 5787 ) randomly into two groups: a training set with 3000 observations and a test set with the rest.
Other model settings remain the same as our simulation in the previous subsection, including the box constraints.
Figure 3 and Table 1 show that the proposed doubly-robust method achieves moderately higher
ROC AUC and classification accuracy than both the plug-in and the raw COMPAS risk scores.
This comparative advantage is likely to increase in settings where we expect the identification and regularity assumptions to be more likely to hold, for example, where we can have access to more covariates or more information about the treatment mechanism.
Discussion
In this paper we studied the problem of counterfactual classification under arbitrary smooth constraints, and proposed a doubly-robust estimator which leverages nonparametric machine learning methods.
Our theoretical framework is not limited to counterfactual classification and can be applied to other settings where the estimand is the optimal solution of a general smooth nonlinear programming problem with a counterfactual objective function; thus, we complement the results of [23, 32], each of which considered a particular class of smooth nonlinear programming.
We emphasize that one may use our proposed approach for other common problems in causal inference, e.g., estimation of the contrast effects or optimal treatment regimes, even under runtime confounding and/or other practical constraints.
We may accomplish this by simply estimating each component E
[ Y a | X ] via solving ( P ) for different values of a , and then taking the conditional mean contrast of interest.
We can also readily adapt our procedure ( P ) for such standard estimands, for example by replacing Y a with the desired contrast or utility formula, in which the influence function will be very similar to those already presented in our manuscript.
In ongoing work, we develop extensions for estimating the CATE and optimal treatment regimes under fairness constraints.
Although not explored in this work, our estimation procedure could be improved by applying more sophisticated and flexible modeling techniques for solving ( P ).
One promising approach is to build a neural network that minimizes the loss (4) with the nuisance estimates { φ a ( Z i ; (cid:98) η − B K ) } i constructed on the separate independent sample; in this case, β is the weights of the network where k ≫ k ′ .
Importantly, in the neural network approach we do not need to specify and construct the score and basis functions; the ideal form of those unknown functions are learned through backpropagation.
Hence, we can avoid explicitly formulating and solving a complex non-convex optimization problem.
Further, one may enjoy a rich source of deep-learning tools.
In future work, we plan to pursue this extension and apply our methods to a large-scale real-world dataset.
We conclude with other potential limitations of our methods, and ways in which our work could be generalized.
First, we only considered the situations where the feasible set is deterministic and fixed.
However, sometimes it may be useful to consider the general case where the feasible set can be different between the true and the approximating programs as in [23]; this corresponds to the case where g j ’s are to be estimated as well.
This can be particularly helpful when incorporating (counterfactual) fairness constraints [32, 33].
Dealing with the varying feasible set with general nonlinear constraints is a complicated task and requires even stronger assumptions [48].
As future work, we plan to generalize our framework to the case of a varying feasible set.
Next, although we showed that the counterfactual objective function is estimated efficiently via (cid:98) L , it is unclear whether the solution estimator (cid:98) β is efficient too, due to the inherent complexity of the optimal solution mapping in the presence of constraints.
We conjecture that one may show that the semiparametric efficiency bound can be also attained for (cid:98) β possibly under slightly stronger regularity assumptions, but we leave this for future work.