Hyperparameter Tuning for Causal Inference with Double Machine Learning: A Simulation Study

Philipp Bach, Oliver Schacht, Victor Chernozhukov, Sven Klaassen, Martin Spindler

Introduction

Double Machine Learning (DML) provides a robust framework for estimating causal effects by leveraging machine learning (ML) to handle high-dimensional nuisance parameters. However, the transition from pure prediction to causal inference introduces complexities, particularly regarding hyperparameter tuning. While tuning is standard in predictive modeling, its role in DML is less understood. Improperly tuned models can lead to significant bias in causal estimates. This paper presents a comprehensive simulation study to establish best practices for hyperparameter tuning in DML.

Methodology: Tuning and Data Splitting

A central challenge in DML is integrating hyperparameter tuning with the "cross-fitting" technique used to prevent overfitting. The authors evaluate three primary sample-splitting schemes for tuning:

  1. Full Sample Tuning: Hyperparameters are optimized via cross-validation on the entire dataset before being applied to all DML cross-fitting folds.
  2. Split Sample Tuning: The dataset is divided; one half is used for tuning, and the other for the DML procedure.
  3. On-Folds Tuning: Tuning is performed via nested cross-validation within each individual DML training fold.
Schematic representation of the three hyperparameter tuning schemes: (a) Full Sample, (b) Split Sample, and (c) On Folds.

The study compares these schemes across several ML learners, including Lasso, Random Forest, XGBoost, and the FLAML AutoML framework. Additionally, it examines two causal models: the Partially Linear Regression (PLR) model for constant effects and the Interactive Regression Model (IRM) for heterogeneous effects.

Key Findings

The Necessity of Tuning

The simulations reveal that tuning is non-negotiable. Using default hyperparameters often results in severe bias, as out-of-the-box settings are rarely optimized for the specific nuisance functions required for causal isolation.

Efficiency and Data Starvation

A critical insight is the inefficiency of the "Split Sample" approach. By allocating half the data solely to tuning, this method starves the final causal model of training samples, leading to higher variance and error. In contrast, "Full Sample" and "On Folds" tuning provide comparable, superior performance by utilizing data more efficiently.

Relative Root Mean Squared Error (rRMSE) across different learners and tuning schemes.

Model Selection via Predictive Loss

Researchers often face uncertainty when choosing between causal models (e.g., PLR vs. IRM). The study finds that the predictive error on the outcome variable ($Y$) is a strong indicator of the appropriate causal model. Selecting the model that minimizes predictive loss correctly identified the superior causal framework in over 75% of heterogeneous treatment effect scenarios.

The Power of AutoML

The FLAML AutoML framework emerged as a highly effective "set-and-forget" option. It consistently achieved competitive results across diverse data-generating processes, matching or exceeding the performance of manually tuned learners and even specialized causal neural networks on benchmarks like IHDP.

Conclusion

Effective causal inference with DML requires careful hyperparameter tuning. To maximize data efficiency and minimize bias, researchers should prefer tuning on the full sample or within cross-fitting folds rather than further splitting the dataset. Furthermore, monitoring nuisance model performance—specifically the predictive loss of the outcome—provides a reliable compass for both learner and causal model selection.

Summary updated

BibTeX
@inproceedings{bach2024hyperparameter,
  author = {Philipp Bach and Oliver Schacht and Victor Chernozhukov and Sven Klaassen and Martin Spindler},
  title = {{Hyperparameter Tuning for Causal Inference with Double Machine Learning: A Simulation Study}},
  booktitle = {CLeaR},
  year = {2024},
}
Figure