Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides applying the EconML Python package to estimate heterogeneous treatment effects from observational data with machine learning.
92% 100%+8 ptsof test cases passed
Passed 24 of 24 test cases with the skill, and 22 of 24 without it.
Write the Python import statement to import DMLOrthoForest from the EconML library.
Imports DMLOrthoForest from econml.orf
3 of 3 safety checks passed
EconML is a Python package developed by Microsoft Research as part of the ALICE (Automated Learning and Intelligence for Causation and Economics) project. It provides a comprehensive suite of methods for estimating heterogeneous treatment effects from observational data, bridging the gap between modern machine learning and classical econometric techniques for causal inference.
Traditional econometric approaches to causal inference often rely on strong parametric assumptions and struggle with high-dimensional data. Pure machine learning methods excel at prediction but do not inherently distinguish correlation from causation. EconML combines the strengths of both paradigms, offering methods that leverage the flexibility of ML for nuisance parameter estimation while maintaining the rigorous causal identification guarantees of econometric theory.
The library implements cutting-edge methods from the academic literature including Double Machine Learning (DML), Causal Forests, Doubly Robust Learners, Orthogonal Random Forests, and Instrumental Variable methods with ML first stages. These tools are essential for researchers across economics, public health, education policy, and any field where understanding causal mechanisms from non-experimental data is critical.
Install EconML via pip:
pip install econml
For the full feature set including optional dependencies:
pip install econml[all]
EconML builds on top of scikit-learn and integrates with the broader Python data science ecosystem. Core dependencies include numpy, scipy, pandas, scikit-learn, and statsmodels. Optional dependencies for specific estimators include LightGBM and PyTorch.
Verify installation:
import econml
print(econml.__version__)
from econml.dml import LinearDML
from econml.orf import DMLOrthoForest
print("EconML loaded successfully")
Double Machine Learning (DML): The workhorse method for estimating average and heterogeneous treatment effects while controlling for high-dimensional confounders. DML uses cross-fitting and orthogonalization to eliminate regularization bias:
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.