Causal Treatment Models Skill

SkillAI & models

Use this skill whenever the scientific target is a treatment effect rather than ordinary outcome prediction: propensity weighting, S/T/X learners, doubly robust learning, policy learning, causal forests, TARNet, DragonNet, CATE estimation, heterogeneous treatment effects, and individualized treatment selection. Triggers include 'causal inference', 'treatment effect', 'CATE', 'ATE', 'propensity score', 'IPW', 'doubly robust', 'causal forest', 'TARNet', 'DragonNet', and 'treatment policy'.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Causal Treatment Models Skill skill

What this skill tells your AI

The instructions your AI receives, as published by cuhk-aim-group/neurodiscovery in skills/causal-treatment-models/SKILL.md and read by ahel’s review.

Overview

causal-treatment-models estimates average or conditional treatment effects from observational subject-level features. It is for the contrast Y(1) - Y(0), not for predicting the observed outcome alone.

Supported estimators

ModelOutput
ipwpropensity-weighted ATE as constant CATE
s_learnersingle outcome model treatment contrast
t_learnerseparate treated/control outcome models
x_learnerimputed effects blended by propensity
doubly_robustdoubly robust pseudo-outcome CATE
policy_learnerinterpretable treatment assignment policy
causal_foresteconml CausalForestDML
tarnetshared representation with two outcome heads
dragonnetTARNet plus propensity head

The CLI uses cross-fitted held-out predictions. Causal interpretation still requires consistency, positivity, no unmeasured confounding, and a defensible temporal ordering.


Installation

pip install numpy pandas scipy scikit-learn joblib torch

For Causal Forest:

pip install econml

Workflows

1. Prepare treatment data

subject_id,treatment,response,age,sex,baseline_score,roi_001
sub-001,1,4.2,64,0,18.0,0.12
sub-002,0,1.7,59,1,17.5,0.08

Treatment must be binary for the current CLI. Include only pretreatment covariates in the feature matrix.

2. Doubly robust CATE

python skills/causal-treatment-models/scripts/train_reference.py \
  --features treatment.csv \
  --treatment-col treatment \
  --outcome-col response \
  --subject-col subject_id \
  --model doubly_robust \
  --folds 5 \
  --output-dir run_models_output/treatment_dr

3. Neural treatment-effect model

python skills/causal-treatment-models/scripts/train_reference.py \
  --features treatment.csv \
  --treatment-col treatment \
  --outcome-col response \
  --model dragonnet \
  --epochs 200 \
  --device cuda \
  --output-dir run_models_output/dragonnet

4. Causal Forest or policy learning

Use --model causal_forest for nonlinear heterogeneous effects and --model policy_learner for a compact treatment rule. Report overlap, propensity distributions, standardized mean differences, ATE/CATE uncertainty, and policy value under an explicit evaluation design.


Input / Output Summary

ItemFormat
InputCSV with subject, treatment, outcome, pretreatment covariates
Treatmentbinary 0/1
Predictionspredictions.csv with held-out CATE and policy
Fold membershipfold_assignments.csv
Metricsmetrics.json with effect/policy summaries
Checkpointcheckpoint.joblib
Provenanceconfig.json, run_manifest.json

Do not describe a high predictive score as causal evidence. Negative controls, sensitivity analyses, and randomized validation remain separate requirements.


Testing

pytest models/tests/test_extended_models.py -q
python skills/causal-treatment-models/scripts/train_reference.py --help

causal_forest tests require the optional econml installation.


Directory Reference

models/causal_treatment/
├── estimators.py       IPW, meta-learners, DR, policy, forest, neural models
└── train.py            cross-fitted CLI

skills/causal-treatment-models/
├── SKILL.md
└── scripts/train_reference.py

Reference

  • Shalit et al. representation learning for individual treatment effects (2017).
  • Shi et al. DragonNet for targeted regularization (2019).
  • econml provides the optional CausalForestDML backend.

Created At: 2026-07-26 HKT Last Updated At: 2026-07-29 HKT Author: chengwang96

Signals

GitHub stars
85
Forks
4
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
causal-treatment-models-cuhk-aim-group
Source
github.com/cuhk-aim-group/neurodiscovery