Skip to content

DataFrameMapper cannot leverage special fit_transform methods #150

Closed
@SandroCasagrande

Description

@SandroCasagrande

For transformers in a DataFrameMapper, it would be useful to be able to access native combined fit_transform methods. This would allow e.g. for the different semantics of PCA(..., copy=False).fit_transform(X) versus .fit(X).transform(X), or the optimized version of DictVectorizer.fit_transform for sparse matrices, etc.

The current implementation of DataFrameMapper can only access each transformers fit and transform method successively. It's implementaion of fit_transform is the default inherited from TransformerMixin which always calls fit(...).transform(...).

It should be quite simple to extend DataFrameMapper to account for this issue. I have the code prepared and will create a PR.

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