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

Skip to content

Add __getitem__ to ColumnTransformer? #15346

@thomasjpfan

Description

@thomasjpfan

Now that we have pipeline['preprocessor'] do we want to extend this to ColumnTransformer. For example:

preprocessor = ColumnTransformer(
    ('ohe', OneHotEncoder(), [...]), 
    ('scaler', StandardScaler(), [...]))
pipeline = Pipeline(
    ('preprocessor', preprocessor),
    ('est', RidgeCV())
)
feature_names = pipeline['preprocessor']['ohe'].get_feature_names(...)

Currently we would have to do

feature_names = (pipeline['preprocessor']
                 .named_transformers_['ohe']
                 .get_feature_names(...))

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