A hospital rolls out a risk-score alert and sees that patients who received the alert had longer stays than patients who did not.
Did the alert lengthen stays? Almost certainly the alert was shown to sicker patients, and sicker patients stay longer for reasons that have nothing to do with the alert. The raw comparison answers a different question from the one the hospital asked.
The first half of this article is about the question the hospital asked: what would have happened to the same patients under the other action? That is a causal question, and it cannot be answered by fitting a better predictor. A model that predicts length of stay from the alert flag and the patient’s features will learn the association faithfully, and the association is the wrong target. We need assumptions that connect what we saw to what we did not see, a way to estimate the target under those assumptions, and a way to learn how much to trust it.
The second half turns the same machinery on a decision problem that machine-learning teams meet constantly. A recommender, a pricing rule or a triage policy has been running in production and has logged its context, its action and the observed reward. We want to know how a different policy would have performed, without deploying it. This is off-policy evaluation, and it is the causal problem of the first half with the treatment replaced by an action chosen by a policy.
Every estimator in this article is tested on simulated data whose true answer is known, because that is the only setting in which a causal estimator can be checked. In real data the truth is never available, and the assumptions of the companion book example cannot be verified from the data alone. Keep that in mind when you read the tables: they show what the estimators do when the assumptions hold or fail in a way we control.
Continue with the book
Explore the full treatment, worked examples, and exercises in Applied AI Under Uncertainty.
Companion article for Applied AI Under Uncertainty, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.
