Skip to content
mlmentorship

Causal inference for ML decisions

Prediction estimates what will happen; causal inference estimates what an intervention will change. Define the estimand, assumptions, assignment process, and identification strategy.

Published · 9 min read ·Role-specific ·Advanced

Visual quick review

See the backdoor path that makes an observed support-message association differ from the intervention effect.

A shared cause can link messages and churn without a treatment effect

A common cause can create an association without a treatment effectPrior engagement affects messages and churn in this graph. An intervention cuts engagement’s assignment arrow into messages. Association alone does not establish a messages-to-churn effect.Assignment and intervention havedifferent arrowsObserve: common cause U assigns bothUXYIntervene: cut the assignment edgeinto XUXYU: engagement. X: messages. Y: churn.
Read it this way: Prior engagement affects messages and churn in this graph. An intervention cuts engagement’s assignment arrow into messages. Association alone does not establish a messages-to-churn effect. Which arrow is removed by assigning messages independently of prior engagement?
Full explanation 9 min read
Reading depth

Summary

Prediction asks what is likely under observed data; a causal decision asks what a defined intervention would change. Specify the target population, assignment mechanism, identification assumptions, and estimator before interpreting an association as an effect.

A Support-Message Decision

Consider this hypothetical two-hundred-user population, with difficulty measured before any message:

DifficultyMessaged: churn/usersUnmessaged: churn/users
High
Low

Recipients churn at versus for nonrecipients, an observed difference of positive three percentage points. Should messages be withheld because recipients churn more? Not from this association alone: the high-difficulty group is much more likely to receive messages.

Potential outcomes and estimands

For each unit , define two potential outcomes:

Let treatment one mean receiving the defined support message and treatment zero mean not receiving it. Fix a churn window and assume no cross-user spillovers for this simple unit-level target. Only one potential outcome is observed per user; the individual effect is unavailable directly.

A common target is the average treatment effect:

Effects on treated users, eligible users, compliers, or conditional subgroups target different populations. Policy value additionally depends on the proposed treatment rule and its constraints.

Why prediction can mislead

Difficulty affects both message assignment and churn, opening a noncausal route between the two. The graph asserts that causal structure; predictive accuracy alone cannot establish or remove the confounding.

A directed acyclic graph can express the claim:

Confounding

Reference drawing

A shared cause can link messages and churn without a treatment effect

A common cause can create an association without a treatment effectPrior engagement affects messages and churn in this graph. An intervention cuts engagement’s assignment arrow into messages. Association alone does not establish a messages-to-churn effect.Assignment and intervention havedifferent arrowsObserve: common cause U assigns bothUXYIntervene: cut the assignment edgeinto XUXYU: engagement. X: messages. Y: churn.
Derivation
A shared cause can connect treatment and outcome without the treatment effectDifficulty D points to both treatment T and outcome Y, creating the backdoor association path T left arrow D right arrow Y. The separate T to Y edge is the effect of interest. Adjustment conditions on D without physically removing a causal arrow.D: userdifficultyT: supportmessageY: churnassignmentoutcomeBACKDOOR: T <- D -> YAdjustment conditions on D; it does not erasearrows.
Follow the two difficulty arrows as one backdoor route. The horizontal treatment arrow is a different path. Adjustment does not physically delete arrows.
Check: Which route can associate support messages with churn even without a treatment effect?
Read it this way: Prior engagement affects messages and churn in this graph. An intervention cuts engagement’s assignment arrow into messages. Association alone does not establish a messages-to-churn effect. Which arrow is removed by assigning messages independently of prior engagement?

For this calculation only, assume pre-treatment difficulty suffices to block confounding and both actions have support in each group. Within high difficulty, observed rates are versus ; within low difficulty, versus . The target population is half high difficulty and half low difficulty, so standardization gives:

The adjusted contrast is , or 7.5 percentage points less churn, under the declared assumptions. This is teaching arithmetic without estimated uncertainty, not evidence that actual support messages reduce churn.

Randomized experiments

Valid random assignment provides independence from potential outcomes under its design. Analyze assignment and the resulting intervention using the correct randomization units and outcome weights. With noncompliance, the assignment effect need not equal the effect of actually receiving the message.

Check:

  • assignment versus actual exposure;
  • sample-ratio mismatch;
  • interference between units;
  • attrition and missing outcomes;
  • novelty and long-term effects;
  • heterogeneous effects;
  • guardrail outcomes.

Randomization does not fix an undefined intervention, missing outcomes, interference, or an inappropriate target population.

Backdoor adjustment

In observational data, a backdoor adjustment set blocks noncausal paths from treatment to outcome .

Under consistency, positivity, and no unmeasured confounding given covariates ,

These assumptions mean:

  • consistency: the observed outcome under the received treatment matches the defined potential outcome;
  • positivity: each relevant covariate group has some chance of each treatment;
  • exchangeability: conditional on , treatment assignment is independent of the potential outcomes, not necessarily the observed outcome.

These assumptions cannot all be verified from this table. Adjusting for post-message satisfaction can remove mediated effects or introduce bias; adding variables is not automatic identification.

Change the Requirement

Remove Observable Support

New task: Nobody with severe difficulty goes untreated.

Picture and change: That group’s untreated propensity becomes zero, removing its observed comparison.

Check: A zero untreated count cannot supply the group’s counterfactual risk.

Use when: A proposed policy includes actions absent from historical data. Seek defensible additional evidence or explicitly narrow the target; outcome-model extrapolation alone does not restore identification.

Change the Assignment Evidence

New task: Compare before/after churn in rollout and comparison regions.

Picture and change: Use outcome changes and justify parallel untreated trends, including anticipation and composition checks.

Check: Treated churn versus comparison gives percentage points.

Use when: A defensible time-comparison design replaces individual randomization. The two before/after numbers alone cannot verify the counterfactual parallel-trends assumption.

Propensity scores and weighting

The propensity score is

Inverse-propensity weighting estimates a pseudo-population in which treatment is less associated with measured covariates. For the ATE, treated units receive weight and control units receive weight .

The fixture has propensities and . Its weighted message risk is ; untreated risk is . Large weights can indicate weak overlap and high variance; inspect distributions and effective sample sizes. Weight capping changes the estimator and can introduce bias; trimming or redefining the population needs an explicit target and justification.

A propensity model balances measured covariates. It does not remove unmeasured confounding.

Doubly robust estimation

A doubly robust estimator combines outcome and propensity models. Under identification, overlap, and suitable convergence conditions, consistency can survive misspecification of one nuisance model if the other is correct.

This does not protect against a wrong estimand, poor overlap, interference, or unmeasured confounding. Use cross-fitting for flexible ML nuisance models to reduce overfitting bias.

Difference in differences

Difference in differences compares outcome changes over time between treated and comparison groups:

The main assumption is parallel trends: without treatment, the average outcome paths would have changed similarly. Inspect pre-treatment trends and consider anticipation, changing group composition, and treatment timing.

Regression discontinuity

A sharp cutoff design can identify a local effect when potential-outcome means are continuous through the threshold. Check manipulation, other simultaneous policy changes, covariate behavior, bandwidth sensitivity, and functional forms. An inability to manipulate the score is not alone sufficient; fuzzy compliance needs a separate identification argument. Do not generalize the local effect across the entire population without additional assumptions.

Interference and feedback

Standard potential-outcome notation assumes one unit’s treatment does not change another unit’s outcome. This fails in social networks, marketplaces, auctions, and shared-capacity systems.

Cluster randomization, switchbacks, and exposure models must match the plausible spillovers and carryover; their names do not remove interference. Recommendation policies also change future training data, so define the horizon and feedback included in the target policy value.

Worked example

As a separate decision illustration, high-intent users receive more premium content and subscribe more often. The observed association does not identify exposure’s effect because intent changes both assignment and outcome. Transporting the support-message calculation would require this setting’s own population, intervention, support, and identification argument.

In an interview

Use this order:

  1. Separate prediction from intervention.
  2. Define treatment, outcome, population, and estimand.
  3. Draw the assignment process or causal graph.
  4. Prefer randomization when feasible.
  5. State every observational identification assumption.
  6. Check overlap, interference, missing outcomes, and sensitivity.
  7. Connect the estimate to a decision.

A strong answer says what cannot be learned from the available data. Method names do not replace identification.

Common mistakes

  • Interpreting feature importance as causal effect.
  • Controlling for variables produced after treatment.
  • Assuming propensity weighting removes all confounding.
  • Ignoring overlap and extreme weights.
  • Using difference in differences without checking pre-treatment trends.
  • Generalizing a regression-discontinuity estimate far from the cutoff.
  • Ignoring interference or policy feedback.

Practice next

Apply this framework in A/B testing for ML, ML experiment design, offline-online metric debugging, and personalized ranking.

For deeper study, see Causal Inference: What If by Hernán and Robins.