Skip to content

ENH Improve warnings if func returns a dataframe in FunctionTransformer - #26944

Merged
glemaitre merged 5 commits into
scikit-learn:mainfrom
thomasjpfan:function_transform_warning
Sep 19, 2023
Merged

glemaitre merged 5 commits into
scikit-learn:mainfrom
thomasjpfan:function_transform_warning

Conversation

@thomasjpfan

Copy link
Copy Markdown
Member

Reference Issues/PRs

Closes #26552

What does this implement/fix? Explain your changes.

This PR implements the suggestion in #26552 (comment). The warning is now delayed to transform and not in set_output.

@github-actions

github-actions Bot commented Jul 30, 2023 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 15b9b14. Link to the linter CI: here

@glemaitre
glemaitre self-requested a review August 12, 2023 10:54

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on my side. Thanks @thomasjpfan

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the use of the present tense in the warning message a bit confusing (see below) but other than that LGTM. Thanks for the UX fix!

Comment thread sklearn/preprocessing/_function_transformer.py Outdated
Comment thread sklearn/preprocessing/tests/test_function_transformer.py Outdated
thomasjpfan and others added 2 commits August 30, 2023 15:00
@glemaitre
glemaitre merged commit 89ea028 into scikit-learn:main Sep 19, 2023
@glemaitre

Copy link
Copy Markdown
Member

Thanks @thomasjpfan

lesteve pushed a commit to lesteve/scikit-learn that referenced this pull request Sep 28, 2023
…er (scikit-learn#26944)

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
…er (scikit-learn#26944)

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive warning in FunctionTransformer

3 participants