Skip to content

Deprecate Imputer with axis=1 #9463

@jnothman

Description

@jnothman

After having tried to deal with a few issues related to extending Imputer behaviour, I believe we should be removing the axis parameter from Imputer.

  • It seems a strange feature to support in a machine learning context, except perhaps where the features represent something like a time series.
  • It is not stateful and can be performed with a FunctionTransformer. (We could even provide a row_impute function, if we felt it necessary, which would roughly be defined as def row_impute(X, **kwargs): return Imputer(**kwargs).fit_transform(X.T).T.)
  • It complicates the implementation, which already has a bunch of weird edge-cases (to handle sparse data with missing indicated by 0 which is an inefficient use of a sparse data structure; and to handle non-NaN missingness indicators), unnecessarily.
  • It is often nonsensical to extend further features to the axis=1 case.

Do others agree?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions