Allow arm-specific numerator/denominator weight models#57
Merged
Conversation
SEQopts numerator/denominator now accept either a single formula (shared across treatment arms, unchanged) or a list with one formula per treatment_level, fitting a separate weight model with its own covariates in each arm. Supported for post-expansion weights only (weight_preexpansion=False), mirroring SEQTaRget commit 761d0d6. _fit_numerator/_fit_denominator select each arm's formula inside the per-level loop; _col_string gathers referenced columns across list elements; _param_checker validates the list (weighted non-ITT, post-expansion, no None entries, length equal to treatment_level) and makes the identical-formula warning list-aware. The prediction path is unchanged because it uses the fitted per-level models directly. Adds tests/test_armspecific_weights.py.
Polars 2.0 flips the explode() empty_as_null default from True to False, which would silently turn exploded empty lists from null rows into dropped rows.
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.
Same addition as to SEQTaRget.
Also explicitly setting an argument for a forthcoming Polars change in default behaviour.