Skip to content

Fix output-axis reductions and DR variance propagation - #1069

Draft
kbattocchi wants to merge 3 commits into
kebatt/causal-forest-standard-errorsfrom
kebatt/numpy-reduction-fixes
Draft

kbattocchi wants to merge 3 commits into
kebatt/causal-forest-standard-errorsfrom
kebatt/numpy-reduction-fixes

Conversation

@kbattocchi

@kbattocchi kbattocchi commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Following up on #1067, had Copilot audit the codebase for other places where we wrongly use a numpy operation on a whole array instead of specifying an axis.

This PR fixes the four confirmed bugs that the review found, in three logical commits:

  • Normalize output-averaged CV MSE by mean within-output target variance, rather than pooling output means into the variance. Independent outcome offsets no longer spuriously inflate model-selection scores.
  • Scope population Gaussian-mixture interval invalidation to individual outcome/treatment columns. Exclude nonfinite means/scales and nonpositive scales before solving, preserving unaffected intervals and avoiding nontermination.
  • Align DR sample_var vectors and singleton columns with final targets, avoiding unintended sample-by-sample broadcasting and fitting failures.
  • Propagate DR outcome variance separately for each treatment-versus-control contrast using its squared observed-outcome derivative. Observations from unrelated treatment arms contribute zero propagated variance rather than inflating standard errors.

Includes regression tests and directly related documentation. Both separate and multitask DR final models are covered, including trimming, heterogeneous weights/propensities, and summarized-versus-expanded observation equivalence.

@kbattocchi
kbattocchi added this pull request to stack #1070 September 28, 2026 19:44
@kbattocchi
kbattocchi force-pushed the kebatt/numpy-reduction-fixes branch from 2bc7b47 to 366cd5b Compare September 28, 2026 19:53
kbattocchi and others added 3 commits October 1, 2026 15:06
Normalize output-averaged CV MSE by mean within-output variance so independent outcome offsets do not inflate selector scores. Preserve the fast approximation and existing unweighted normalization policy.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Keith Battocchi <kebatt@microsoft.com>
Keep NaN intervals local to outcome/treatment columns with nonpositive scales or nonfinite normal parameters. Exclude invalid columns before solving so unaffected intervals retain their values and shape without risking nontermination.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Keith Battocchi <kebatt@microsoft.com>
Align vector and singleton-column sample variances with final targets, and apply the squared observed-outcome derivative separately for each treatment-versus-control contrast. This avoids quadratic broadcasting and excludes variance from unrelated treatment arms. Cover both final-model modes, trimming, weighted summaries, and expanded-observation covariance equivalence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Keith Battocchi <kebatt@microsoft.com>
@kbattocchi
kbattocchi force-pushed the kebatt/numpy-reduction-fixes branch from 366cd5b to 4ca2540 Compare October 1, 2026 19:06

This branch has not been deployed

No deployments
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