Generalize · Chapter 10 of 12
Double machine learning
Objective: Derive an orthogonal partial-linear score and understand the role and limits of sample splitting and nuisance learning.
Can flexible prediction estimate a training effect without absorbing the effect we want?
Machine learning · DML · Cross-fitting · Orthogonality
Before you begin: Conditional and iterated expectations (chapter 2), projection and residualization (chapter 3), and asymptotic inference (chapter 4). The remainder analysis uses little-o rate notation, defined where it first appears.
About 35 minutes, plus the exercises.
Prediction and causal estimation
A model predicts employee output extremely well from past performance, job role, manager ratings, and training participation. That may help staffing. It does not establish what would happen if the firm changed training assignments.
Prediction evaluates a forecast against an observed outcome under a stated data distribution and loss. Causal estimation needs a target and identifying restrictions. Flexible learning is valuable within that argument: it can estimate complicated conditional relationships that would be difficult to specify by hand. It cannot supply missing randomization or remove unmeasured confounding by predictive accuracy alone.
Training and evaluation samples
For squared-error prediction, define risk as for a new observation and the specified training procedure. More flexibility can reduce approximation bias while increasing estimation variability. The direction of the net change is an empirical question for honest evaluation.
Use training data to fit, validation data to select, and untouched evaluation data to estimate performance. Preprocessing, feature selection, and tuning belong inside the appropriate training split. Looking repeatedly at the final holdout and changing the model spends its independence. Split by the unit of dependence and by time when the deployment task requires it.
For causal work, excluding post-treatment variables and information unavailable at the decision date comes before a prediction contest.
A partial-linear target
Consider independent observations satisfying
where is training dose, contains pre-treatment covariates, and is a constant partial-linear coefficient. For a causal interpretation, the conditional mean restriction and structural interpretation must be credible, including the absence of relevant unmeasured confounding. This model is restrictive; arbitrary heterogeneous effects need different target definitions.
Define , , and . Iterated expectations imply , hence
If , multiplying by and taking expectations identifies . Covariates may predict much of training, but some residual treatment variation must remain.
Why the score is orthogonal
Use the residual-on-residual score
At the true functions and coefficient, , with mean zero. Now perturb the nuisance functions along fixed square-integrable directions: and . At ,
Differentiate its expectation at zero:
Each term vanishes because and . This is Neyman orthogonality: small nuisance errors have no first-order effect on the population moment at the truth. It is a local insensitivity result, not immunity to arbitrary model errors.
What error remains?
Let and be nuisance errors trained on independent data. The same expansion gives the exact conditional population drift
By Cauchy–Schwarz, its magnitude is bounded by
where . A random sequence is when converges in probability to zero. Sufficient rate conditions make both terms . Taking both nuisance errors to be suffices; other combinations are possible provided the product and the squared treatment-model error satisfy the condition. This parameterization should not be silently exchanged for a score using the structural function .
Together with nuisance consistency, suitable moments and sampling conditions, and bounded away from zero, these restrictions support asymptotically linear inference. Orthogonality alone is insufficient.
Cross-fit, then estimate
Partition observations into a fixed number of folds. For every fold, estimate and using the other folds and predict the held-out observations. Let and . Pool the held-out residuals:
Cross-fitting limits own-observation overfitting bias while reusing data. Under the required conditions,
The asymptotic variance is . A corresponding standard-error estimate is
Dependence or clustered assignment needs an appropriate extension. None of these calculations measures uncertainty from omitted confounding.
Residual regression example
Suppose held-out residuals in a synthetic example are and . Their cross-product sums to 21 and squared treatment residuals sum to 10, so .
d, y = [-2, -1, 1, 2], [-5, -1, 2, 4]
theta = sum(a * b for a, b in zip(d, y)) / sum(a * a for a in d)
print(theta) # 2.1
This example calculates the final residual regression. A full DML analysis also requires nuisance estimation, cross-fitting, and inference.
Exercises
1. Suppose has order and has order . Do the displayed sufficient remainder conditions follow?
Work through the solution
No. Their product has order , which alone does not give the required little-o rate. More importantly, has order , generally too slow when . Faster treatment-model learning or a different valid construction is needed.
2. Managers use unrecorded motivation to select training. Cross-fitted output prediction is excellent. Which identifying condition remains doubtful?
Work through the solution
If motivation affects output beyond recorded , the disturbance may satisfy . Cross-fitting cannot make that conditional mean restriction true. Seek additional design information, a valid instrument, sensitivity analysis, or a more limited predictive claim.
Further reading
Chernozhukov and coauthors’ original DML paper provides the framework and regularity conditions. Ahrens and coauthors’ introduction, revised in February 2026, is a current explanatory companion to this established methodology.
Write the claim and the assumption doing the most work. Saved only in this browser on this device; avoid sensitive information. Private browsing or clearing site data can erase it.
Notes are optional.
“Explored” records your choice, not a score or a claim of mastery.