The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
intervention-learning-framework (v1, milestone 1)
A recursive intervention-learning framework for a real-time sales-call
assistant, built simulator-first: every estimator is validated by
recovering known ground truth from the generative simulator in intervene/sim/.
No production data exists yet; nothing in this repo claims a result from real
data, and no estimate is reported without an uncertainty interval.
Milestone 1 scope: simulator + detection + offline effect estimation, with
the confounding parameter-recovery test passing. policy/, ope/,
discover/ and monitor/ are documented skeletons for later milestones;
planning/ is implemented (it is small and gates runnability).
Install & run
pip install -e ".[dev]"
pytest # parameter-recovery suite
python scripts/run_experiment.py --n-calls 25000 --seed 20260910
Determinism: every stochastic component takes one master seed; child RNGs are
spawned from it via numpy.random.SeedSequence.
Layout
| Module | Contents |
|---|---|
intervene/domain/ |
Versioned pydantic v2 models (MomentDefinition, MomentInstance, Intervention, Decision, Outcome), version-immutability registry |
intervene/sim/ |
Seeded generative simulator + analytic ground truth (quadrature, no Monte-Carlo truth) |
intervene/detect/ |
Calibrated per-definition classifiers (isotonic/Platt), PR curves, ECE, cost-based thresholds (C_fp/C_fn default 3:1) |
intervene/effects/ |
Pooled, stratified, IPW (Horvitz-Thompson) estimators, all with 95% Wald intervals, confounding warning |
intervene/planning/ |
Two-proportion sample size + calendar-time calculator (proxy and objective) |
intervene/policy/, ope/, discover/, monitor/ |
Milestone-2 skeletons with documented interfaces |
Estimator assumptions and where they break
Pooled difference (effects/estimators.py)
- Assumes: treatment randomised within the moment population.
- Breaks: under any confounding — biased, sometimes badly (the confounding test demonstrates a ~10σ bias). Only ever report it next to an adjusted one.
Stratified / size-weighted difference
- Assumes: confounding operates only through the strata; independent strata; Wald variance within stratum.
- Breaks: confounders varying within strata (only partial adjustment — see the confounding test: bias shrinks but does not vanish); sparse strata where an arm is empty (those strata are dropped, changing the estimand).
IPW (Horvitz–Thompson) using logged propensities
- Assumes: propensities logged at decision time and treated as known (correct, since the logging policy logged them); positivity (0 < e < 1).
- Breaks: propensities near 0/1 (variance explodes; the estimator refuses e ∉ (0,1)); any decision logged without a propensity — the domain model raises a hard validation error at construction, so such records cannot enter the pipeline.
Detector calibration (isotonic / Platt)
- Assumes: training and scoring distributions match.
- Breaks: distribution shift (moment base-rate drift / feedback
contamination — monitored by
intervene/monitor/, milestone 2); isotonic needs large samples per fold, Platt degrades with extreme class imbalance.
Doubly robust (milestone 2) will require both a correct propensity model and a correct outcome model; it is listed here because its failure mode (error when either model is wrong, provided not both) is the reason it is preferred over IPS.
The confounding test (the core of milestone 1)
tests/test_effects_confounding.py builds a moment whose intervention has a
true-zero effect but whose logging policy assigns treatment increasingly
to high-quality accounts, which also convert better. On 25k simulated calls:
- the pooled estimator is biased upward with a confidence interval excluding zero;
- the IPW estimator using the logged propensities covers zero;
flag_confoundingfires because the two intervals do not overlap;- on a companion moment with a real effect, IPW covers the analytically computed true ATE.
See DECISIONS.md for every modelling choice and its rejected alternative.
- Downloads last month
- 91