Econml 模型配置
- 作者仓库星标 307
- 许可证 MIT
- 作者仓库 zorai
Overview
EconML is a Microsoft library for causal inference and heterogeneous treatment effect estimation using machine learning. Implements Double ML, Causal Forest, DML, IV methods, and orthogonal statistical learning. Designed for observational data where treatment effects vary across individuals.
Installation
uv pip install econml
Double ML (Linear)
from econml.dml import LinearDML
import numpy as np
X = np.random.randn(500, 5) # features
T = np.random.randn(500) # treatment
Y = T * (0.5 + X[:, 0]) + np.random.randn(500) # outcome
est = LinearDML(model_y="auto", model_t="auto", discrete_treatment=False)
est.fit(Y, T, X=X)
print(f"ATE: {est.ate():.3f} ± {est.ate_inference().stderr:.3f}")
Causal Forest
from econml.grf import CausalForest
cf = CausalForest(n_estimators=100, min_samples_leaf=10)
cf.fit(X, T, Y)
treatment_effects = cf.effect(X)
print(f"Heterogeneous effects range: {treatment_effects.min():.3f} to {treatment_effects.max():.3f}")
References
- 流狐分类
- 通用 · econml · causal-inference · heterogeneous-treatment-effects
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 100 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @mkurman · MIT
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 即装即用
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
作者没有在当前 SKILL.md 中定义固定输出样例。 Overview
EconML is a Microsoft library for causal inference and heterogeneous treatment effect estimation using machine learning. Implements Double ML, Causal Forest, DML, IV methods, and orthogonal statistical learning. Designed for observational data where treatment…
Installation
Installation
Double ML (Linear)
Double ML (Linear)
Causal Forest
Causal Forest
References
EconML docs EconML GitHub
## Overview
EconML is a Microsoft library for causal inference and heterogeneous treatment effect estimation using machine learning. Implements Double ML, Causal Forest, DML, IV methods, and orthogonal statistical learning. Designed for observational data where treatment effects vary across individuals.
## Installation
```bash
uv pip install econml
```
## Double ML (Linear)
```python
from econml.dml import LinearDML
import numpy as np
X = np.random.randn(500, 5) # features
T = np.random.randn(500) # treatment
Y = T * (0.5 + X[:, 0]) + np.random.randn(500) # outcome
est = LinearDML(model_y="auto", model_t="auto", discrete_treatment=False)
est.fit(Y, T, X=X)
print(f"ATE: {est.ate():.3f} ± {est.ate_inference().stderr:.3f}")
```
## Causal Forest
```python
from econml.grf import CausalForest
cf = CausalForest(n_estimators=100, min_samples_leaf=10)
cf.fit(X, T, Y)
treatment_effects = cf.effect(X)
print(f"Heterogeneous effects range: {treatment_effects.min():.3f} to {treatment_effects.max():.3f}")
```
## References
- [EconML docs](https://econml.azurewebsites.net/)
- [EconML GitHub](https://github.com/py-why/EconML) 证据边界与执行链路
作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Overview → Installation → Double ML (Linear) → Causal Forest → References
要点 -> EconML is a Microsoft library for causal inference and heterogeneous treatment effect estimation using machine learning.
文件/命令 -> github.com/py-why/EconML
内容 SHA-256 -> ffc705ea4493
原文结构
适用与边界
原文中的明确线索
github.com/py-why/EconML