Description
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