-
-
Notifications
You must be signed in to change notification settings - Fork 26.1k
FIX Adds check_array to inverse_transform of StandardScaler #19356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX Adds check_array to inverse_transform of StandardScaler #19356
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR.
Please add a non-regression test that would fail at main but pass in this PR.
…nto check_array_StandardScaler
Hi @makoeppel, adding a |
I added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ensure_2d
should be True
and the current behavior is a bug. test_transform_target_regressor_2d_transformer
is taking advantage of this bug. Unfortunately, setting ensure_2d=True
would be not be backward compatible. I opened #19518 to discuss this issue.
For now, we can merge this as it resolves the dtype issue and is backward compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an entry to the change log at doc/whats_new/v1.0.rst
with tag |Fix|. Like the other entries there, please reference this pull request with :pr:
and credit yourself with :user:
.
330cb1e
to
17dd5be
Compare
Reference Issues/PRs
Fixes #19354
What does this implement/fix? Explain your changes.
This PR checks the input array of the
inverse_transform
function of the StandardScaler similar like its done in the MinMaxScaler.