Логотип Econml Causal Guide

Econml Causal Guide

Сообщество
wentorai
econml-causal-guide

Apply EconML for causal inference combining machine learning and econometrics

Обзор

Издательwentorai
Репозиторийresearch-plugins
Название навыкаeconml-causal-guide
Звёзды
294
Форки
42
Файлы в комплекте
Только инструкции
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Всё необходимое — в инструкциях

    Всё необходимое для модели содержится в инструкциях — никаких дополнительных файлов для синхронизации.

  • Открытый исходный код

    Издатель навыка на GitHub — wentorai. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Econml Causal Guide в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/econml-causal-guide
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wentorai/research-plugins.git /tmp/research-plugins
mkdir -p .claude/skills
cp -r /tmp/research-plugins/skills/analysis/econometrics/econml-causal-guide .claude/skills/econml-causal-guide
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Econml Causal Guide в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Econml Causal Guide, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Econml Causal Guide не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

EconML Causal Inference Guide

Overview

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.

Installation and Setup

Install EconML via pip:

bash
pip install econml

For the full feature set including optional dependencies:

bash
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:

python
import econml
print(econml.__version__)

from econml.dml import LinearDML
from econml.orf import DMLOrthoForest
print("EconML loaded successfully")

Core Estimators and Methods

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:

python
from econml.dml import LinearDML, CausalForestDML
from sklearn.ensemble import GradientBoostingRegressor

# Linear DML for parametric treatment effect estimation
est = LinearDML(
    model_y=GradientBoostingRegressor(),
    model_t=GradientBoostingRegressor(),
    cv=5,
    random_state=42
)
est.fit(Y, T, X=X, W=W)

# Get treatment effect estimates with confidence intervals
effect = est.effect(X_test)
ci = est.effect_interval(X_test, alpha=0.05)
print(f"ATE: {est.ate():.4f}")
print(f"ATE 95% CI: {est.ate_interval(alpha=0.05)}")

Here Y is the outcome, T is the treatment, X contains effect modifiers (features for heterogeneity), and W contains additional confounders.

Causal Forest DML: Combines DML orthogonalization with Causal Forest estimation for flexible, nonparametric heterogeneous treatment effects:

python
from econml.dml import CausalForestDML

cf_est = CausalForestDML(
    model_y=GradientBoostingRegressor(),
    model_t=GradientBoostingRegressor(),
    n_estimators=200,
    min_samples_leaf=10,
    cv=5,
    random_state=42
)
cf_est.fit(Y, T, X=X, W=W)

# Heterogeneous treatment effects
hte = cf_est.effect(X_test)
# Feature importance for treatment effect heterogeneity
importances = cf_est.feature_importances_

Doubly Robust Learner: Provides consistent treatment effect estimates when either the outcome model or the propensity score model is correctly specified:

python
from econml.dr import DRLearner
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor

dr_est = DRLearner(
    model_propensity=RandomForestClassifier(),
    model_regression=RandomForestRegressor(),
    model_final=RandomForestRegressor(),
    cv=5
)
dr_est.fit(Y, T, X=X, W=W)

Instrumental Variable Methods: For settings where unobserved confounding is present but valid instruments are available:

python
from econml.iv.dml import DMLIV

iv_est = DMLIV(
    model_y_xw=GradientBoostingRegressor(),
    model_t_xw=GradientBoostingRegressor(),
    model_t_xwz=GradientBoostingRegressor(),
    cv=5
)
iv_est.fit(Y, T, Z=Z, X=X, W=W)

Research Workflow Integration

Experiment Analysis: When randomized experiments suffer from non-compliance or attrition, use IV methods in EconML to recover local average treatment effects. The ML-based first stages handle complex relationships between instruments and treatment uptake.

Policy Evaluation: Estimate heterogeneous treatment effects to identify which subpopulations benefit most from an intervention. The CATE (Conditional Average Treatment Effect) estimates can directly inform targeted policy design:

python
# Identify subgroups with largest treatment effects
import pandas as pd

effects_df = pd.DataFrame({
    "effect": cf_est.effect(X_test).flatten(),
    "ci_lower": cf_est.effect_interval(X_test, alpha=0.05)[0].flatten(),
    "ci_upper": cf_est.effect_interval(X_test, alpha=0.05)[1].flatten()
}, index=X_test.index)

# Top beneficiaries
top_group = effects_df.nlargest(100, "effect")

Sensitivity Analysis: Combine EconML estimates with sensitivity analysis frameworks to assess robustness to potential unobserved confounders. Report how much unmeasured confounding would be required to explain away your findings.

Publication-Ready Results: EconML provides confidence intervals and hypothesis tests based on asymptotic theory, producing results suitable for peer-reviewed publications. Use the summary methods to generate formatted regression-style output.

Best Practices for Academic Research

  1. Always validate assumptions: DML requires conditional ignorability (selection on observables). Document your identification strategy clearly.
  2. Cross-fitting is essential: Never skip the cross-fitting step, as it prevents overfitting bias in the nuisance estimates.
  3. Report multiple estimators: Present results from DML, DR Learner, and Causal Forest side by side to assess robustness.
  4. Check overlap: Verify sufficient overlap in covariate distributions between treated and control groups before estimation.
  5. Use honest estimation: EconML Causal Forests use sample splitting for honesty by default, ensuring valid inference.

References

Часто задаваемые вопросы

Что делает навык ИИ Econml Causal Guide?

Apply EconML for causal inference combining machine learning and econometrics

Зачем использовать Econml Causal Guide в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Econml Causal Guide — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Econml Causal Guide в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/wentorai/research-plugins/tree/main/skills/analysis/econometrics/econml-causal-guide. TypingMind прочитает файл SKILL.md и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Econml Causal Guide?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Econml Causal Guide?

С любым количеством. В TypingMind вы можете использовать Econml Causal Guide с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Econml Causal Guide?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — wentorai. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇