Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove SimpleImputer's axis parameter #10636
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:
@qinhanmin2014 and @jnothman I need help, I'm a little confused, should I remove all mentions from the SimpleImputer
In the code the
For example in the code below (in impute.py class SimpleImpute) should I remove these entries from the
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
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
We might also want to help users a bit more and say
in what's new.