Skip to content

Experiment: ITE/ATE recovery vs training-set size (overfitting check)#24

Merged
oduerr merged 1 commit into
mainfrom
feat/ite-train-size-experiment
Jun 26, 2026
Merged

Experiment: ITE/ATE recovery vs training-set size (overfitting check)#24
oduerr merged 1 commit into
mainfrom
feat/ite-train-size-experiment

Conversation

@oduerr

@oduerr oduerr commented Jun 26, 2026

Copy link
Copy Markdown
Member

Follow-up to the ITE benchmark (#23): a small experiment quantifying how the
all-CI S-learner TRAM-DAG's effect recovery scales with training-set size, and
whether it overfits.

experiments/ite_train_size.py fits the notebook's all-CI model on
n = 500, 1000, 2000, 5000, 10000, 20000 observational rows and evaluates
every model on the same fixed 5000-row test set, reporting:

  • ATE recovery — predicted vs the known true ATE (−0.576);
  • ITE recovery — correlation and MAE vs the per-individual true ITE;
  • overfitting — the train-vs-test NLL gap.

Median over 3 seeds (data draw + weight init); per-seed points overlaid.

Findings (median, fixed 5k test)

n_train ATE ITE corr ITE MAE NLL gap (test−train)
500 −0.624 0.441 0.401 1.068
1000 −0.518 0.770 0.270 0.374
2000 −0.607 0.828 0.169 0.231
5000 −0.551 0.935 0.117 0.078
10000 −0.558 0.964 0.071 0.052
20000 −0.566 0.982 0.050 0.024

A clear systematic dependency: ITE correlation climbs 0.44 → 0.98 and the
overfitting gap closes from ~1.07 to ~0.02, essentially converged by n ≈ 5000.
The ATE is roughly unbiased even at small n (it's an average), but the
individual effects are not recoverable until there's enough data.

Small-n instability (reported honestly, not hidden)

At n=500, 1 of 3 seeds had its counterfactual extrapolation blow up — a few
test individuals' predicted ITE reached ~1e7 (the all-CI Bernstein inverse
extrapolating wildly on a poorly-constrained fit) even though that seed's NLL
was normal
. The plots use the median over seeds and clip such points to the
axis edge with an annotation, so one blow-up doesn't rescale the figure. This is
itself part of the overfitting story.

results/ is gitignored (like the other experiments); regenerate with
uv run python experiments/ite_train_size.py. Two figures are written under
results/ite_train_size/plots/ (ITE scatter grid + the summary curves), shown in
the chat.

🤖 Generated with Claude Code

experiments/ite_train_size.py: fit the all-CI S-learner TRAM-DAG from the ITE
notebook on n = 500..20000 observational rows, evaluate every model on the same
fixed 5k test set, and report ATE recovery, ITE correlation/MAE, and the
train-vs-test NLL gap (overfitting diagnostic). Median over 3 seeds; per-seed
points overlaid. Robust to the small-n counterfactual blow-up (one n=500 seed's
ITE extrapolates to ~1e7 while its NLL stays normal — clipped + annotated, not
allowed to rescale the axes).

Findings (median, fixed 5k test): ITE corr 0.44 -> 0.98, MAE 0.40 -> 0.05, and
the NLL gap 1.07 -> 0.02 as n grows from 500 to 20000 — a clear systematic
dependency with the overfitting gap closing by n~5000. results/ is gitignored;
regenerate with `uv run python experiments/ite_train_size.py`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@oduerr oduerr merged commit eda4934 into main Jun 26, 2026
2 checks passed
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