-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG+1] Deprecate axis parameter in imputer #10558
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
[MRG+1] Deprecate axis parameter in imputer #10558
Conversation
…and equals to 0 when axis is None.
LGTM |
@jnothman Since that you reviewed the original PR, I think that this is ready to be merged. |
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.
doc/modules/preprocessing.rst
sets axis explicitly and will now raise a warning. examples/plot_missing_values.py
does too. They should be changed.
sklearn/preprocessing/imputation.py
Outdated
warnings.warn("Parameter 'axis' has been deprecated in 0.20 and " | ||
"will be removed in 0.22. Future (and default) " | ||
"behavior is equivalent to 'axis=0' (impute along " | ||
"columns).", DeprecationWarning) |
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.
We should probably say "Row-wise imputation can be performed with FunctionTransformer." Could even specify FunctionTransformer(lambda X: Imputer(...).fit_transform(X.T).T)
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.
Thanks
Thanks @glemaitre @jnothman :) |
FYI, this seems to have broken a test:
The issue is that the axis check was not altered to be
I can fix this in the MICE PR, as this change also effects how MICE will make use of |
The fix is here: 8350981 |
Please submit a separate PR... why is this not failing in master? |
OK will do. No idea why it's not failing in master. |
Hmm, it looks correct in master. It's probably a mistake I made while merging the MICE PR to master, but I'm not sure how that would have happened. My apologies for the bother! |
Reference Issues/PRs
Fixes #9463
Closes #9672
What does this implement/fix? Explain your changes.
We are unable to contact with the author of the original PR, so I try to complete it.
Improvements (according to the reviews in #9672):
(1) Improve the deprecation message
(2) Add a test
(3) Correct what's new
(4) Ignore deprecation warnings in the tests (since there are too many warnings)
Any other comments?