Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove SimpleImputer's axis parameter #10636

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

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
Labels
Easy Well-defined and straightforward way to resolve good first issue Easy with clear instructions to resolve help wanted

Comments

@jnothman
Copy link
Member

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
@jnothman jnothman added good first issue Easy with clear instructions to resolve help wanted Easy Well-defined and straightforward way to resolve labels Feb 14, 2018
@qinhanmin2014
Copy link
Member

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

@giba0
Copy link

giba0 commented Feb 14, 2018

Newbie here! Can I work on this?

@qinhanmin2014
Copy link
Member

@gilbertoolimpio go ahead please

@jnothman
Copy link
Member Author

jnothman commented Feb 14, 2018 via email

@jnothman
Copy link
Member Author

jnothman commented Feb 14, 2018 via email

@giba0
Copy link

giba0 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
Copy link
Member Author

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
Copy link
Member Author

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.

giba0 added a commit to giba0/scikit-learn that referenced this issue Feb 17, 2018
@bhaveshpoddar94
Copy link

First Time Contributor. Can I look into this issue?

@qinhanmin2014
Copy link
Member

@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
Labels
Easy Well-defined and straightforward way to resolve good first issue Easy with clear instructions to resolve help wanted
Projects
None yet
4 participants