liveBook · Manning

Cross-validation

As explained in Causal Inference for Data Science

Cross-validation is a model-evaluation procedure that repeatedly partitions data into training and validation portions to estimate predictive performance.

Cross-validation estimates how well a trained predictive model is likely to perform on new data by repeatedly separating available data into training and validation portions. Its reassurance depends on a key condition: future data must behave similarly to past data. It answers whether a prediction system is likely to work as expected, not whether changing the system’s inputs will cause a desired outcome. section 1.2

Use cross-validation to compare alternative supervised-learning models and select the one with stronger predictive capability on held-out test data. For a classifier that supplies probabilities, such as a propensity-score model, evaluate discrimination with AUC rather than accuracy when the target is the probability of treatment. section 5.3.2 section 5.3.2

Accurate predictions can still mislead interventions

A game-level dataset makes bonuses decrease as ghosts increase, while both affect completion time. A regression using bonuses alone has an R-squared of 0.9969; adding ghosts raises it only to 0.9996, so both appear similarly predictive. But when a designer changes the historical relationship and adds ghosts and bonuses together, the models make sharply different predictions. Cross-validation could assess predictive error under historical-like data, yet it cannot establish which model correctly predicts the consequence of a new design. section 4.1.5

Keep the boundary between prediction and causal inference explicit:

  • Treat a good cross-validation result as evidence for prediction when the deployment setting resembles the observed data-generating setting. section 1.2
  • Do not select a causal model solely by cross-validation, because predictive fit does not determine the effect of an intervention. section 4.6
  • When machine learning supplies conditional probabilities for adjustment with many confounders, use cross-fitting even if cross-validation selected the predictive model. section 4.6
  • Interpret high AUC differently for propensity scores: near-perfect treatment prediction can indicate poor comparability between treated and untreated cases. section 5.3.2

How Causal Inference for Data Science covers it

How deep it goes
Explains predictive-model selection and its causal limitations, but does not detail fold construction or scoring procedures.
Examples
Uses house inspection versus earthquake resistance and Pac-Man level regressions with bonuses, ghosts, and completion time.
What it assumes
Assumes familiarity with supervised models and introduces cross-validation through its evaluation role rather than its mechanics.
What you can do after
Evaluate predictive models by held-out capability while avoiding cross-validation alone as a basis for causal-model choice.
How it connects
Connects supervised learning, predictive error, causal inference, propensity scores, AUC, adjustment, and cross-fitting.

Also explained in

Compare how 12 books explain cross-validation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal Inference for Data Science. The section links point to the parts of the book it draws on.