py-why/EconML
ALICE (Automated Learning and Intelligence for Causation and Economics) is a Microsoft Research project aimed at applying Artificial Intelligence concepts to economic decision making. One of its goals is to build a toolkit that combines state-of-the-art machine learning techniques with econometrics in order to bring automation to complex causal inference problems. To date, the ALICE Python SDK (econml) implements orthogonal machine learning algorithms such as the double machine learning work of Chernozhukov et al. This toolkit is designed to measure the causal effect of some treatment variable(s) t on an outcome variable y, controlling for a set of features x.
What it solves
EconML helps answer a specific question: when you apply a treatment (like a drug, a discount, or a policy) to different people, how does the effect differ from person to person? It estimates these heterogeneous treatment effects from historical or observational data—data that wasn't collected through a controlled experiment. This is useful for personalized decision-making, like figuring out which customers respond best to a marketing campaign or which patients benefit most from a medication.
How it works
EconML combines machine learning with econometrics (the science of causal inference). You give it an outcome variable Y, a treatment variable T, and a set of features X (the characteristics that might change the effect) and W (other variables that could confound the relationship). It then estimates how the causal effect of T on Y varies as a function of X. The package includes many modern techniques—like double machine learning, causal forests, meta-learners, and doubly robust learners—and it can handle cases where you have an instrumental variable Z (a variable that affects the treatment but not the outcome directly) to deal with unobserved confounders. Most methods also provide confidence intervals, so you know how reliable the estimates are.
Who it’s for
EconML is aimed at data scientists, economists, and researchers who need to estimate causal effects from non-experimental data and want to use flexible machine learning models (like random forests, boosting, or lasso) without losing the ability to interpret the results causally. It’s built on standard Python tools like scikit-learn, so it fits into existing ML workflows. The package is part of Microsoft Research’s ALICE project and is designed to automate complex causal inference problems.
Highlights
- Estimates heterogeneous treatment effects—how the effect of an intervention varies across individuals—from observational data.
- Combines state-of-the-art machine learning with econometrics to preserve causal interpretation.
- Offers a unified API across many estimation methods, including double machine learning, causal forests, meta-learners, and doubly robust learners.
- Supports instrumental variables to handle unobserved confounders.
- Provides confidence intervals for most methods, so you can assess uncertainty.
- Includes interpretability tools like tree-based interpreters and SHAP values to explain the estimated effect model.
- Built on standard Python packages for machine learning and data analysis.
Related
- Project
- Project
- Project
- Project
- Project