Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

FunctionTransformer.transform() API Confusion #24829

Copy link
Copy link
Closed
@cjuracek

Description

@cjuracek
Issue body actions

Describe the issue linked to the documentation

Documentation in question: https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.FunctionTransformer.html#sklearn.preprocessing.FunctionTransformer.transform

I need the FunctionTransformer in order to convert some of my image normalization functions into Pipeline components. At normalization time, the dataset of images can't be coerced into a 2D array (they are different sizes and color modes) - the input I need to be acceptable is a list of non-uniform images. The API states that X should be an array like, with (n_samples, n_features) dimensions. Thus, I thought I couldn't use this feature.

However, array input is not required. When I configured my underlying function to accept a list, then I can pass a List into FunctionTransformer.transform(). If this isn't a desired workflow, I'd appreciate knowing of any alternatives.

Suggest a potential alternative/fix

I'm proposing the parameter/docs be changed from:

  • X: array-like, shape (n_samples, n_features)

To:

  • X: Input satisfying the requirements of the underlying function

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.