fix: split_y_true slices exactly one treatment column (v0.1.3) - #23
Merged
Merged
Conversation
y_true[:, n_outcome_true_cols:] took all remaining columns for treatment_true instead of exactly one. Every committed loss/model has a single treatment column so this was correct by accident; a y_true with extra trailing columns (e.g. downstream survival/auxiliary columns) would silently fold into treatment_true with no error. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SdCb8CoUX1aJbyHVgM5cF5
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
split_y_true(pypsps/utils.py) slicedtreatment_trueas "all remaining columns after outcome" instead of exactly one column. Every committed loss/model has a single treatment column, so this was correct by accident — ay_truewith extra trailing columns would silently fold intotreatment_truewith no error.[n_outcome_true_cols : n_outcome_true_cols + 1].Test plan
pytest pypsps/tests/test_utils.py pypsps/tests/test_losses.py pypsps/tests/test_metrics.py— 26 passedpytest pypsps/tests— 84 passed, 3 skipped🤖 Generated with Claude Code
https://claude.ai/code/session_01SdCb8CoUX1aJbyHVgM5cF5