← all repositories
py-why/EconML

Causal inference for people who can't run A/B tests forever

Microsoft Research's EconML brings econometric rigor to observational data, estimating how treatments affect different subgroups without requiring randomized experiments.

4.7k stars Jupyter Notebook ML FrameworksDomain Apps
EconML
Not currently ranked — collecting fresh signals.
star history

What it does

EconML estimates heterogeneous treatment effects — essentially, “what happens if we do X, and does it work better for some people than others?” — using only observational (non-experimental) data. It wraps methods like double machine learning, causal forests, and orthogonal random forests into a scikit-learn-compatible API, so you can plug in your favorite regressors and classifiers while still getting valid confidence intervals and causal interpretations.

The interesting bit

The toolkit sits at an unusual intersection: it preserves the formal causal guarantees of econometrics (no unobserved confounders, or valid instruments) while letting you model effect heterogeneity with whatever ML flavor you prefer — random forests, boosting, lasso, neural nets. Most methods even provide proper inference, not just point estimates. It’s the rare package that takes “what if we treated econometrics like an ML pipeline?” seriously rather than as marketing.

Key highlights

  • Implements recent literature at the econometrics/ML boundary (Chernozhukov et al.’s double ML, causal forests, etc.)
  • Effect heterogeneity modeled via standard sklearn estimators — swap in LassoCV, RandomForestRegressor, or whatever fits your data
  • Most estimators return confidence intervals via bootstrap, debiased lasso, or forest-specific methods
  • Handles panel data via DynamicDML for time-varying treatments
  • Built by Microsoft Research’s ALICE project, with active releases through mid-2025

Caveats

  • Causal claims require strong assumptions: no unobserved confounders for most methods, or access to valid instruments for others — the README is explicit about this, but it’s easy to ignore in practice
  • The API is unified but the underlying methods are not; you still need to know which estimator matches your identification strategy

Verdict

Worth a look if you’re doing policy evaluation, pricing experiments, or any scenario where randomized trials are impossible or unethical. Skip it if you just need prediction without causation — standard sklearn will be faster and less opinionated.

Frequently asked

What is py-why/EconML?
Microsoft Research's EconML brings econometric rigor to observational data, estimating how treatments affect different subgroups without requiring randomized experiments.
Is EconML open source?
Yes — py-why/EconML is an open-source project tracked on heatdrop.
What language is EconML written in?
py-why/EconML is primarily written in Jupyter Notebook.
How popular is EconML?
py-why/EconML has 4.7k stars on GitHub.
Where can I find EconML?
py-why/EconML is on GitHub at https://github.com/py-why/EconML.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.