Skip to content

feat: target treatment lift at a single metric when set#58

Merged
mohossam01 merged 1 commit into
mainfrom
feat/per-metric-treatment-effects
May 15, 2026
Merged

feat: target treatment lift at a single metric when set#58
mohossam01 merged 1 commit into
mainfrom
feat/per-metric-treatment-effects

Conversation

@mohossam01
Copy link
Copy Markdown
Owner

@mohossam01 mohossam01 commented May 15, 2026

What this PR does

Adds per-metric treatment targeting. A treatment cohort can now direct its lift at a single named metric, leaving all other metrics unaffected. When no target metric is set, treatment applies trajectory-wide as before with byte-identical output. The validator rejects target metric names that don't match a declared metric, and the manifest records the target metric per entity and per cohort.

Files Modified

plotsim/config.py
plotsim/validation.py
plotsim/metrics.py
plotsim/tables.py
plotsim/builder/input.py
plotsim/builder/interpreter.py
plotsim/manifest.py
plotsim-schema.json
tests/test_per_metric_treatment.py
tests/test_manifest.py
tests/test_heteroscedastic_noise.py
tests/test_multi_source.py
tests/test_time_varying_correlations.py
CHANGELOG.md
docs/site/manifest-reference.md
docs/site/user-guide/experiments-and-cohorts.md

How to test

python -m pytest tests/test_per_metric_treatment.py
python -m pytest tests/test_treatment_control.py
python -m pytest

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mohossam01 mohossam01 merged commit 340e794 into main May 15, 2026
6 checks passed
@mohossam01 mohossam01 deleted the feat/per-metric-treatment-effects branch May 15, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant