Fix output-axis reductions and DR variance propagation - #1069
Draft
kbattocchi wants to merge 3 commits into
Draft
kbattocchi wants to merge 3 commits into
kbattocchi wants to merge 3 commits into
Conversation
kbattocchi
added this pull request to stack #1070
September 28, 2026 19:44
kbattocchi
force-pushed
the
kebatt/numpy-reduction-fixes
branch
from
September 28, 2026 19:53
2bc7b47 to
366cd5b
Compare
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
force-pushed
the
kebatt/numpy-reduction-fixes
branch
from
October 1, 2026 19:06
366cd5b to
4ca2540
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
sample_varvectors and singleton columns with final targets, avoiding unintended sample-by-sample broadcasting and fitting failures.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.