Can predictive models be used for causal inference? Preprint
Abstract
Supervised machine learning (ML) and deep learning (DL) algorithms excel at predictive tasks, but it is commonly assumed that they often do so by exploiting non-causal correlations, which may limit both interpretability and generalizability. Here, we show that this trade-off between explanation and prediction is not as deep and fundamental as expected. Whereas ML and DL algorithms will indeed tend to use non-causal features for prediction when fed indiscriminately with all data, it is possible to constrain the learning process of any ML and DL algorithm by selecting features according to Pearl's backdoor adjustment criterion. In such a situation, some algorithms, in particular deep neural networks, can provide near unbiased effect estimates under feature collinearity. Remaining biases are explained by the specific algorithmic structures as well as hyperparameter choice. Consequently, optimal hyperparameter settings are different when tuned for prediction or inference, confirming the general expectation of a trade-off between prediction and explanation. However, the effect of this trade-off is small compared to the effect of a causally constrained feature selection. Thus, once the causal relationship between the features is accounted for, the difference between prediction and explanation may be much smaller than commonly assumed. We also show that such causally constrained models generalize better to new data with altered collinearity structures, suggesting generalization failure may often be due to a lack of causal learning. Our results not only provide a perspective for using ML for inference of (causal) effects but also help to improve the generalizability of fitted ML and DL models to new data.
What the paper shows and why it matters (AI-generated)
Machine learning (ML) models, including deep learning, are seen as good predictors but poor explainers: they exploit correlations with features not causally connected to the outcome. This view is reflected in the position that predictive models are not for causal inference (Arif and MacNeil 2022; Shmueli 2010), which is reasonable for models fed all features. Causal inference theory, however, says how to choose features from a known causal graph so that a regression adjusts for confounders (common causes of a feature and the outcome), and Zhao and Hastie (2021) noted this should in principle carry over to ML. This is uncertain because the regularisation in ML algorithms can bias the effects of correlated (collinear) features. The paper questions the assumption that this trade-off between prediction and explanation is fundamental to ML algorithms.
The paper argues that the trade-off between predicting well and estimating effects correctly with machine-learning models is smaller than assumed, because much of it stems from which features the model is given, not only from the algorithm. When features are chosen with the backdoor criterion, a rule that blocks confounding, some algorithms estimate effects almost without bias. In simulations, neural networks without regularisation were nearly unbiased, whereas random forests showed strong “causal spillover”, in which an effect moves onto a correlated feature that has none. Hyperparameters (tuning settings) best for estimating effects differed from those best for prediction, but only slightly next to the gain from causal feature selection. In a simulated lung-cancer example, models lacking the collider variable lung volume (a variable caused by two others) predicted slightly worse on data like the training data but better in a randomised trial, where feature correlations differ.
The results suggest that, if the causal graph is known, certain flexible ML models, neural networks in particular, can in principle be used like a multiple regression to estimate adjusted effects, and could beat parametric models when relationships are nonlinear or interactive. In the simulated case study, causal feature selection lowered the error on new data with different feature correlations, which suggests that some failures of ML to generalise may reflect a failure to learn causal structure. The paper notes limits: the graph must be known, guarantees are lacking, and comparison with double/debiased ML (Chernozhukov et al. 2018) is left open.
References
- Arif & MacNeil (2022). Predictive models aren't for causal inference. Ecology Letters 25, 1741–1745. doi:10.1111/ele.14033
- Shmueli (2010). To Explain or to Predict? Statistical Science 25, 289–310. doi:10.1214/10-sts330
- Zhao & Hastie (2021). Causal Interpretations of Black-Box Models. Journal of Business & Economic Statistics 39, 272–281. doi:10.1080/07350015.2019.1624293
- Chernozhukov et al. (2018). Double/debiased machine learning for treatment and structural parameters. The Econometrics Journal 21, C1–C68. doi:10.1111/ectj.12097