Skip to content
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

Remove SimpleImputer's axis parameter #10636

Closed
jnothman opened this issue Feb 14, 2018 · 10 comments · Fixed by #10829
Closed

Remove SimpleImputer's axis parameter #10636

jnothman opened this issue Feb 14, 2018 · 10 comments · Fixed by #10829

Comments

@jnothman
Copy link
Member

@jnothman jnothman commented Feb 14, 2018

We recently (#10483) moved sklearn.preprocessing.Imputer to sklearn.impute.SimpleImputer to make way for other imputation strategies (and to acknowledge that imputation is a kind of learning problem in itself).

We also want to get rid of the axis parameter. In fact we did this in #10558, before realising that if we're deprecating all of preprocessing.Imputer, it's unnecessary. Since SimpleImputer is not yet released, we do not need to deprecate the parameter.

So your mission is to emulate #10558 but don't bother with deprecation:

  • to remove all mentions of SimpleImputer's axis
  • to update the what's new entry about moving Imputer to SimpleImputer with a comment that axis has been removed
@qinhanmin2014

This comment has been minimized.

Copy link
Member

@qinhanmin2014 qinhanmin2014 commented Feb 14, 2018

To dear contributors: It's recommended to go through the comments in #10483 (e.g., #10483 (comment))

@gilbertoolimpio

This comment has been minimized.

Copy link

@gilbertoolimpio gilbertoolimpio commented Feb 14, 2018

Newbie here! Can I work on this?

@qinhanmin2014

This comment has been minimized.

Copy link
Member

@qinhanmin2014 qinhanmin2014 commented Feb 14, 2018

@gilbertoolimpio go ahead please

@jnothman

This comment has been minimized.

Copy link
Member Author

@jnothman jnothman commented Feb 14, 2018

@jnothman

This comment has been minimized.

Copy link
Member Author

@jnothman jnothman commented Feb 14, 2018

@gilbertoolimpio

This comment has been minimized.

Copy link

@gilbertoolimpio gilbertoolimpio commented Feb 15, 2018

@qinhanmin2014 and @jnothman I need help, I'm a little confused, should I remove all mentions from the SimpleImputer axis only in the documentation? And besides, could you help me how could be the comment that the axis was removed?

In the code the axis often appears as axis = 0, should I change to None or delete these entries as well?

For example in the code below (in impute.py class SimpleImpute) should I remove these entries from the axis parameter or set None?

    def __init__(self, missing_values="NaN", strategy="mean",
                 axis=0, verbose=0, copy=True):
        self.missing_values = missing_values
        self.strategy = strategy
        self.axis = axis
        self.verbose = verbose
        self.copy = copy

tks! =)

@jnothman

This comment has been minimized.

Copy link
Member Author

@jnothman jnothman commented Feb 15, 2018

Because this is not released code, it can be safely removed without breaking backwards compatibility. Just drop axis there. Don't worry about looking at the previous work and comments too much.

Yes, you need to remove from the documentation too, if necessary adjusting the wording to say imputation is done over each column.

In terms of adding a comment on axis being removed, we ultimately want to say something like "sklearn.preprocessing.Imputer has been renamed to sklearn.impute.SimpleImputer, and its axis parameter is no longer available. The deprecated Imputer will be removed in version 0.22." in doc/whats_new/v0.20.rst where the deprecation of Imputer is currently mentioned (but you can use your own words). A mention of axis disappearing is also appropriate in the deprecation warning at

@deprecated("Imputer was deprecated in version 0.20 and will be "

@jnothman

This comment has been minimized.

Copy link
Member Author

@jnothman jnothman commented Feb 15, 2018

We might also want to help users a bit more and say

Future (and default) behavior is equivalent to ``axis=0``
(impute along columns). Row-wise imputation can be performed with
FunctionTransformer (e.g.,
``FunctionTransformer(lambda X: Imputer().fit_transform(X.T).T)``).

in what's new.

gilbertoolimpio added a commit to gilbertoolimpio/scikit-learn that referenced this issue Feb 17, 2018
…into Remove-SimpleImputer-axis-parameter-scikit-learn#10636
@bhaveshpoddar94

This comment has been minimized.

Copy link

@bhaveshpoddar94 bhaveshpoddar94 commented Feb 24, 2018

First Time Contributor. Can I look into this issue?

@qinhanmin2014

This comment has been minimized.

Copy link
Member

@qinhanmin2014 qinhanmin2014 commented Feb 24, 2018

@bhaveshpoddar94 Someone has taken the issue. See the above PR which refers to the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.