Repository navigation
Address JOSS review feedback (#147, #148, #149) - #150
Merged
Merged
Conversation
- Validate/flatten fit inputs: accept single-column outcomes, treatment arms, strata and treatment indicator; reject other shapes and NaN in them. - Fix QTE: use the generalized inverse of the CDF (smallest y with F(y) >= q). - Raise an informative error when cross-fitting leaves no training data and suggest reducing folds. - Clarify that ML adjustment targets variance reduction in randomized experiments, not confounding correction (docstrings, examples, docs). - Add shape and statistical-baseline tests; document missing-value policy. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LjhUSYBaHyrPdnQ7z13FKv
This was referenced Oct 6, 2026
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.
Addresses the issues raised in the JOSS review (openjournals/joss-reviews#11047).
Changes
fitmethods now flatten single-columntreatment_arms,outcomes,strataandtreatment_indicator(e.g. shape(n, 1)) to 1-D and raise a clearValueErrorfor other shapes.predict_dtenow returns identical results forYandY[:, None].predict_qtereturned wrong values (e.g. 1 instead of 5 for a constant shift of 5) because the quantile search returned the largest location withF(y) <= q. It now returns the generalized inverse, the smallestywithF(y) >= q. Addedtests/test_statistical_baselines.pywith hand-computed baselines (DTE/PTE/QTE), a stratified-vs-simple equivalence check, and a simulated normal location-shift DGP with known DTE/QTE for the simple and adjusted estimators (including a CI-width check for the adjusted one). The existing mock-basedtest_predict_qterelied on the buggy behaviour and now uses a CDF mock with a known quantile shift.ValueErrorsuggesting fewerfoldswhen a fold leaves no training data for the target arm.fitrejects NaN intreatment_arms,outcomes,strataandtreatment_indicator; covariates are not checked (depends on the base model). Documented in the get-started guide.Not included
Bootstrap inference options for the partial-compliance (
predict_ldte/predict_lpte) methods. This is a new statistical feature rather than a fix and needs a design that respects the stratified sampling scheme, so I left it for a follow-up.Testing
pytest(72 tests) andruff check .pass.