[![Build Status](https://dev.azure.com/ms/EconML/_apis/build/status/Microsoft.EconML?branchName=master)](https://dev.azure.com/ms/EconML/_build/latest?definitionId=49&branchName=master)
[![PyPI version](https://img.shields.io/pypi/v/econml.svg)](https://pypi.org/project/econml/)
[![PyPI wheel](https://img.shields.io/pypi/wheel/econml.svg)](https://pypi.org/project/econml/)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/econml.svg)](https://pypi.org/project/econml/)
<h1><img src="https://www.microsoft.com/en-us/research/wp-content/uploads/2016/12/MSR-ALICE-HeaderGraphic-1920x720_1-800x550.jpg" width="130px" align="left" style="margin-right: 10px;"> EconML: A Python Package for ML-Based Heterogeneous Treatment Effects Estimation</h1>
**EconML** is a Python package for estimating heterogeneous treatment effects from observational data via machine learning. This package was designed and built as part of the [ALICE project](https://www.microsoft.com/en-us/research/project/alice/) at Microsoft Research with the goal to combine state-of-the-art machine learning
techniques with econometrics to bring automation to complex causal inference problems. The promise of EconML:
* Implement recent techniques in the literature at the intersection of econometrics and machine learning
* Maintain flexibility in modeling the effect heterogeneity (via techniques such as random forests, boosting, lasso and neural nets), while preserving the causal interpretation of the learned model and often offering valid confidence intervals
* Use a unified API
* Build on standard Python packages for Machine Learning and Data Analysis
One of the biggest promises of machine learning is to automate decision making in a multitude of domains. At the core of many data-driven personalized decision scenarios is the estimation of heterogeneous treatment effects: what is the causal effect of an intervention on an outcome of interest for a sample with a particular set of features? In a nutshell, 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, W` and how does that effect vary as a function of `X`. The methods implemented are applicable even with observational (non-experimental or historical) datasets. For the estimation results to have a causal interpretation, some methods assume no unobserved confounders (i.e. there is no unobserved variable not included in `X, W` that simultaneously has an effect on both `T` and `Y`), while others assume access to an instrument `Z` (i.e. an observed variable `Z` that has an effect on the treatment `T` but no direct effect on the outcome `Y`). Most methods provide confidence intervals and inference results.
For detailed information about the package, consult the documentation at https://econml.azurewebsites.net/.
For information on use cases and background material on causal inference and heterogeneous treatment effects see our webpage at https://www.microsoft.com/en-us/research/project/econml/
<details>
<summary><strong><em>Table of Contents</em></strong></summary>
- [News](#news)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Usage Examples](#usage-examples)
- [Estimation Methods](#estimation-methods)
- [Interpretability](#interpretability)
- [Causal Model Selection and Cross-Validation](#causal-model-selection-and-cross-validation)
- [Inference](#inference)
- [For Developers](#for-developers)
- [Running the tests](#running-the-tests)
- [Generating the documentation](#generating-the-documentation)
- [Blogs and Publications](#blogs-and-publications)
- [Citation](#citation)
- [Contributing and Feedback](#contributing-and-feedback)
- [References](#references)
</details>
# News
**January 20, 2021:** Release v0.9.0b1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.9.0b1)
<details><summary>Previous releases</summary>
**November 20, 2020:** Release v0.8.1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.8.1)
**November 18, 2020:** Release v0.8.0, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.8.0)
**September 4, 2020:** Release v0.8.0b1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.8.0b1)
**March 6, 2020:** Release v0.7.0, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.7.0)
**February 18, 2020:** Release v0.7.0b1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.7.0b1)
**January 10, 2020:** Release v0.6.1, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.6.1)
**December 6, 2019:** Release v0.6, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.6)
**November 21, 2019:** Release v0.5, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.5).
**June 3, 2019:** Release v0.4, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.4).
**May 3, 2019:** Release v0.3, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.3).
**April 10, 2019:** Release v0.2, see release notes [here](https://github.com/Microsoft/EconML/releases/tag/v0.2).
**March 6, 2019:** Release v0.1, welcome to have a try and provide feedback.
</details>
# Getting Started
## Installation
Install the latest release from [PyPI](https://pypi.org/project/econml/):
```
pip install econml
```
To install from source, see [For Developers](#for-developers) section below.
## Usage Examples
### Estimation Methods
<details>
<summary>Double Machine Learning (aka RLearner) (click to expand)</summary>
* Linear final stage
```Python
from econml.dml import LinearDML
from sklearn.linear_model import LassoCV
from econml.inference import BootstrapInference
est = LinearDML(model_y=LassoCV(), model_t=LassoCV())
### Estimate with OLS confidence intervals
est.fit(Y, T, X=X, W=W) # W -> high-dimensional confounders, X -> features
treatment_effects = est.effect(X_test)
lb, ub = est.effect_interval(X_test, alpha=0.05) # OLS confidence intervals
### Estimate with bootstrap confidence intervals
est.fit(Y, T, X=X, W=W, inference='bootstrap') # with default bootstrap parameters
est.fit(Y, T, X=X, W=W, inference=BootstrapInference(n_bootstrap_samples=100)) # or customized
lb, ub = est.effect_interval(X_test, alpha=0.05) # Bootstrap confidence intervals
```
* Sparse linear final stage
```Python
from econml.dml import SparseLinearDML
from sklearn.linear_model import LassoCV
est = SparseLinearDML(model_y=LassoCV(), model_t=LassoCV())
est.fit(Y, T, X=X, W=W) # X -> high dimensional features
treatment_effects = est.effect(X_test)
lb, ub = est.effect_interval(X_test, alpha=0.05) # Confidence intervals via debiased lasso
```
* Generic Machine Learning last stage
```Python
from econml.dml import NonParamDML
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
est = NonParamDML(model_y=RandomForestRegressor(),
model_t=RandomForestClassifier(),
model_final=RandomForestRegressor(),
discrete_treatment=True)
est.fit(Y, T, X=X, W=W)
treatment_effects = est.effect(X_test)
```
</details>
<details>
<summary>Causal Forests (click to expand)</summary>
```Python
from econml.dml import CausalForestDML
from sklearn.linear_model import LassoCV
# Use defaults
est = CausalForestDML()
# Or specify hyperparameters
est = CausalForestDML(criterion='het', n_estimators=500,
min_samples_leaf=10,
max_depth=10, max_samples=0.5,
discrete_treatment=False,
model_t=LassoCV(), model_y=LassoCV())
est.fit(Y, T, X=X, W=W)
treatment_effects = est.effect(X_test)
# Confidence intervals via
没有合适的资源?快使用搜索试试~ 我知道了~
EconML:ALICE(因果关系和经济学的自动学习和情报)是一项Microsoft研究项目,旨在将人工智能概念应用于经济决策。...
共197个文件
py:108个
ipynb:29个
rst:18个
需积分: 44 12 下载量 177 浏览量
2021-02-03
06:40:10
上传
评论 1
收藏 17.34MB ZIP 举报
温馨提示
EconML:用于基于ML的异构处理效果估计的Python包 EconML是一个Python软件包,用于通过机器学习从观察数据中估计异构处理效果。 此软件包是作为Microsoft Research的一部分设计和构建的,目的是将最新的机器学习技术与计量经济学相结合,以使自动化解决复杂的因果推理问题。 EconML的承诺: 在计量经济学和机器学习的交集中实现文献中的最新技术 保持建模效果异质性的灵活性(通过诸如随机森林,增强,套索和神经网络之类的技术),同时保留对所学模型的因果解释,并经常提供有效的置信区间 使用统一的API 建立在用于机器学习和数据分析的标准Python软件包的基础上 机器学习的最大希望之一就是在众多领域中自动化决策。 许多数据驱动的个性化决策方案的核心是对异构处理效果的估计:对于具有特定特征集的样本,干预对感兴趣结果的因果关系是什么? 简而言之,该工具包旨在测量某些治疗变量T对结果变量Y的因果效应,控制一组特征X, W以及该效应如何随X 。 所实施的方法甚至适用于观测(非实验或历史)数据集。 为了使估计结果具有因果关系,有些方法假定没有观察到的混杂因素(即, X,
资源详情
资源评论
资源推荐
收起资源包目录
EconML:ALICE(因果关系和经济学的自动学习和情报)是一项Microsoft研究项目,旨在将人工智能概念应用于经济决策。 它的目标之一是构建一个工具包,将最先进的机器学习技术与计量经济学相结合,以使自动化解决复杂的因果推理问题。 迄今为止,ALICE Python SDK(econml)实现了正交机器学习算法,例如Chernozhukov等人的双重机器学习工作。 该工具包旨在测量某些治疗变量t对结果变量y的因果关系,并控制一组特征x (197个子文件)
data_doc.bib 274B
setup.cfg 2KB
example_full.csv 304KB
card.csv 293KB
example.csv 84KB
sim.csv 65KB
NEW7080.dta 37.54MB
.gitignore 1KB
Generalized Random Forests.ipynb 1.27MB
Double Machine Learning Examples.ipynb 800KB
TA_DGP_analysis.ipynb 651KB
TA_DGP_analysis_Step_CATE.ipynb 649KB
Interpretability with SHAP.ipynb 420KB
NLSYM_Linear.ipynb 391KB
ForestLearners Basic Example.ipynb 356KB
high_dim_state_any_m_panel.ipynb 331KB
high_dim_state_any_m_panel_hetero.ipynb 318KB
Case Study - Recommendation AB Testing at An Online Travel Company - EconML + DoWhy.ipynb 309KB
Automated Machine Learning For EconML.ipynb 303KB
Case Study - Customer Segmentation at An Online Media Company - EconML + DoWhy.ipynb 294KB
Causal Model Selection with the RScorer.ipynb 292KB
Doubly Robust Learner and Interpretability.ipynb 280KB
Case Study - Multi-investment Attribution at A Software Company - EconML + DoWhy.ipynb 264KB
NLSYM_Semi_Synthetic_Linear.ipynb 262KB
Causal Forest and Orthogonal Random Forest Examples.ipynb 250KB
NLSYM_Semi_Synthetic_GBM.ipynb 249KB
Case Study - Customer Segmentation at An Online Media Company.ipynb 245KB
Case Study - Recommendation AB Testing at An Online Travel Company.ipynb 236KB
Weighted Double Machine Learning Examples.ipynb 202KB
NLSYM_GBM.ipynb 196KB
postprocess_panel_hetero.ipynb 146KB
Case Study - Multi-investment Attribution at A Software Company.ipynb 136KB
Deep IV Examples.ipynb 129KB
Metalearners Examples.ipynb 103KB
Choosing First Stage Models.ipynb 88KB
post_processing.ipynb 85KB
postprocess_panel.ipynb 55KB
LICENSE 3KB
README.md 26KB
README.md 3KB
README.md 2KB
README.md 1KB
dr_cate_tree.png 183KB
dr_policy_tree.png 66KB
continuous_ortho_forest_doc_example.png 30KB
summary.png 28KB
summary_frame.png 15KB
population_summary.png 12KB
_splitter.pxd 7KB
_tree.pxd 6KB
_criterion.pxd 5KB
_criterion.pxd 5KB
_utils.pxd 3KB
_utils.pxd 1KB
linear_model.py 76KB
_drlearner.py 70KB
dml.py 65KB
_inference.py 65KB
test_dml.py 62KB
_ortho_forest.py 62KB
test_drlearner.py 53KB
_cate_estimator.py 53KB
classes.py 52KB
_base_grf.py 51KB
test_statsmodels.py 49KB
_dml.py 41KB
_ortho_learner.py 41KB
utilities.py 41KB
test_grf_python.py 39KB
_base_grftree.py 36KB
_dr.py 35KB
test_linear_model.py 35KB
causal_forest.py 30KB
test_deepiv.py 29KB
_interpreters.py 29KB
monte_carlo_statsmodels.py 27KB
ortho_forest.py 26KB
dr_iv.py 23KB
test_orf.py 22KB
_metalearners.py 21KB
test_ortho_iv.py 20KB
_rlearner.py 19KB
test_ortho_learner.py 19KB
model_selection.py 18KB
_shap.py 18KB
test_inference.py 18KB
_deepiv.py 17KB
test_refit.py 17KB
test_grf_cython.py 16KB
_tree_exporter.py 16KB
test_bootstrap.py 15KB
test_tree.py 15KB
dml_iv.py 15KB
dynamic_panel_dgp.py 15KB
_automated_ml.py 15KB
coverage_panel_hetero.py 15KB
_tsls.py 15KB
utilities.py 14KB
comparison_plots.py 14KB
monte_carlo.py 14KB
共 197 条
- 1
- 2
苏鲁定
- 粉丝: 23
- 资源: 4574
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0