-
-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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
StandardScaler is stateless
#30840
Comments
Hello @benHeid, thanks for reporting. I have checked and would also think it is a bug. This code returned from sklearn.preprocessing import StandardScaler, MinMaxScaler
print(StandardScaler()._get_tags()["stateless"])
print(MinMaxScaler()._get_tags()["stateless"]) As a workaround please use the The issue is related to #30327. |
Actually it is the right way to do with the new tag infrastructure from sklearn.utils import get_tags
from sklearn.preprocessing import StandardScaler
get_tags(StandardScaler()).requires_fit And indeed, there is a bug with the conversion if the old tag infrastructure that we need to solve. |
So the bug is here: https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/utils/_tags.py#L590 We should change to: "stateless": not new_tags.requires_fit, |
@EmilyXinyi, would you like to take care of that? Don't feel obliged though, only if you like. |
Describe the bug
The StandardScaler seems to be stateless in version 1.6.1. But fit changes the state of the StandardScaler if I got it correctly.
Steps/Code to Reproduce
Expected Results
False
Actual Results
True
Versions
The text was updated successfully, but these errors were encountered: