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.
翻译:监督机器学习(ML)和深度学习(DL)算法在预测任务上表现出色,但通常认为它们往往通过利用非因果相关性实现这一目标,这可能会限制模型的可解释性和泛化能力。本文表明,解释与预测之间的权衡并不如预期那般深刻且根本。虽然ML和DL算法在无差别地使用所有数据时确实倾向于利用非因果特征进行预测,但通过依据Pearl的后门调整准则筛选特征,可以约束任何ML和DL算法的学习过程。在这种情况下,部分算法(尤其是深度神经网络)能够在特征共线性条件下提供近乎无偏的效应估计。剩余偏差归因于特定的算法结构及超参数选择。因此,针对预测或推断进行调优时,最优超参数设置存在差异,这证实了预测与解释之间存在权衡的普遍预期。然而,与因果约束特征选择的影响相比,这种权衡效应较小。一旦考虑了特征间的因果关系,预测与解释之间的差异可能远小于普遍假设的幅度。我们还表明,此类因果约束模型能更好地泛化至具有改变共线性结构的新数据,提示泛化失败可能常源于缺乏因果学习。本研究不仅为利用机器学习推断(因果)效应提供了视角,也有助于提升已拟合ML和DL模型对新数据的泛化能力。