skillfed

econml

This package contains several methods for calculating Conditional Average Treatment Effects

econml v0.17.0 563.1K downloads/30d#5,982 on PyPI4,753
Permissive license MIT Active released

What it is and what it does

EconML is a machine learning toolkit for causal inference that estimates heterogeneous treatment effects—how the causal impact of an intervention on an outcome varies across different groups or feature values. It combines econometric methods with modern ML techniques to work with observational (non-experimental) data, where you measure treatment T's effect on outcome Y while controlling for confounders X and W. The package provides a unified API across multiple estimation strategies, many of which return confidence intervals and statistical inference results.

The core use case is personalized decision-making: given a sample with particular features, what is the expected causal effect of applying a treatment to that sample? This is useful in policy learning, A/B testing analysis, and any domain where you need to understand not just average effects but how effects differ across populations. The package assumes either no unobserved confounders or access to instrumental variables, depending on the method chosen.

Use it for:

  • Estimate how a marketing intervention's effect on customer spending varies by customer demographics or purchase history.
  • Analyze clinical trial or observational medical data to determine which patient subgroups benefit most from a treatment.
  • Evaluate policy interventions to identify which populations see the largest causal effects.
  • Learn optimal treatment assignment policies by combining effect estimation with policy learning methods.
  • Conduct causal model selection and cross-validation to choose among competing heterogeneous effect estimators.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

EconML estimates heterogeneous treatment effects from observational data using machine learning, measuring how causal effects of interventions vary across different sample characteristics.

Yes, if you need to estimate causal treatment effects from observational data and want flexibility in modeling effect heterogeneity. The package is actively maintained, well-documented, MIT-licensed, and has no known vulnerabilities. Install friction is moderate due to dependencies; ensure your environment can build numba and scipy. Not suitable if you only need average treatment effects or lack domain knowledge of causal assumptions.

Install

econml on PyPI

pip

pip install econml

uv

uv add econml

poetry

poetry add econml

Installing econml

Before you install

Medium install friction due to 11 runtime dependencies including numpy, scipy, numba, and lightgbm. Active maintenance with recent release (14 days old) and strong repository signals (4753 stars, last commit 2026-08-11). Prebuilt wheels available for Python 3.9–3.14 across macOS, Linux, and Windows.

License in practice

MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice.

Quickstart

pip install econml

from econml.dml import LinearDML
from econml.inference import BootstrapInference

est = LinearDML(model_y=LassoCV(), model_t=LassoCV())
est.fit(Y, T, X=X, W=W)

Requires Python ≥3.9; medium install friction due to compiled dependencies (numba, scipy, lightgbm) that may require build tools on some systems.

Verify before relying

  • Whether the package supports GPU acceleration or distributed computation for large datasets.
  • Performance characteristics and scalability limits for high-dimensional feature spaces.
  • Specific causal assumptions required by each estimation method and how to validate them.
  • Whether LassoCV is available as a built-in or requires external installation.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction medium — platform-specific wheel
Runtime dependencies 11 — numpy, numba, scipy, scikit-learn, sparse, joblib, statsmodels, pandas, shap, lightgbm, packaging
Maintenance actively maintained — 14 days since the last release
Last repo commit
First released
Downloads 563,080/month — #5,982 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: econml-0.17.0-cp310-cp310-macosx_11_0_arm64.whl; econml-0.17.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; econml-0.17.0-cp310-cp310-win_amd64.whl; econml-0.17.0-cp311-cp311-macosx_11_0_arm64.whl; econml-0.17.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; econml-0.17.0-cp311-cp311-win_amd64.whl; econml-0.17.0-cp312-cp312-macosx_11_0_arm64.whl; econml-0.17.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; econml-0.17.0-cp312-cp312-win_amd64.whl; econml-0.17.0-cp313-cp313-macosx_11_0_arm64.whl; econml-0.17.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; econml-0.17.0-cp313-cp313-win_amd64.whl; econml-0.17.0-cp314-cp314-macosx_11_0_arm64.whl; econml-0.17.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; econml-0.17.0-cp314-cp314t-macosx_11_0_arm64.whl; econml-0.17.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; econml-0.17.0-cp314-cp314t-win_amd64.whl; econml-0.17.0-cp314-cp314-win_amd64.whl; econml-0.17.0-cp39-cp39-macosx_11_0_arm64.whl; econml-0.17.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Keywords: treatment-effect

Operating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

heterogeneous treatment effectscausal inference machine learningtreatment effect estimationconditional average treatment effectsobservational causal analysiseconometrics machine learningpersonalized treatment effects
causal-inferenceeconometricsobservational-data

More Artificial Intelligence packages

Further reading