Repository navigation
Compute scaling state from non-missing observations - #277
Open
lllleolin-max wants to merge 1 commit into
Open
lllleolin-max wants to merge 1 commit into
lllleolin-max wants to merge 1 commit into
Conversation
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.
A single NaN currently makes
center(x)andscale(x)return NaN for every observation, so the default missing-value policy drops the whole sample. Compute each column's mean, sum of squares and observation count from non-missing values while leaving the original missing rows as NaN. This follows the documented R scale semantics, including uncentered root-mean-square scaling. Tests verify column-specific counts, ddof, reused training state and end-to-end materialization.Validation: the added regression tests fail on main (
81e675b) and pass with this patch. Related tests:python -m pytest tests/transforms/test_scale.py tests/transforms/test_patsy_compat.py -q. Changed files passruff checkandruff format.