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

Skip to content

Implement get_feature_names_out for SimpleImputer #21200

@MFairley

Description

@MFairley

Describe the workflow you want to enable

I would like to get the feature names input to a classifier after imputation.

column_trans = ColumnTransformer([('imputed', SimpleImputer(add_indicator=True), x_con)], remainder='drop')
# column_trans = ColumnTransformer([('scaler', preprocessing.StandardScaler(), x_con)], remainder='drop')
pipe = make_pipeline(column_trans, LogisticRegressionCV(cv=2, random_state=0))
pipe.fit(X, y)
pipe[:-1].get_feature_names_out()

Describe your proposed solution

Implement get_feature_names_out for SimpleImputer as it is implemented for other transformers e.g. it works for StandardScaler.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions