FIX FunctionTransformer overwrite column names if not consistent#28241
Merged
Conversation
adrinjalali
reviewed
Jan 25, 2024
adrinjalali
reviewed
Jan 31, 2024
adrinjalali
left a comment
Member
There was a problem hiding this comment.
This ended up a large diff 😁
Member
Author
|
The failure will be solved by merging #28262 |
adrinjalali
reviewed
Feb 1, 2024
adrinjalali
approved these changes
Feb 1, 2024
thomasjpfan
reviewed
Feb 1, 2024
|
As I mentioned before, my pull-request in pycaret to have scikit-learn 1.4 support failed, but now I have just modified the scikit-learn code on my laptop with the modifications in this PR, so far, I have run the scikit-learn test again pycaret that failed because of get_feature_names_out and now the test passed! For more context, I refer to my Pycaret pr with failing tests because of get_feature_names_out, it's here: pycaret/pycaret#3857 |
thomasjpfan
approved these changes
Feb 1, 2024
glemaitre
added a commit
to glemaitre/scikit-learn
that referenced
this pull request
Feb 10, 2024
glemaitre
added a commit
to glemaitre/scikit-learn
that referenced
this pull request
Feb 13, 2024
glemaitre
added a commit
that referenced
this pull request
Feb 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #28232
This make the
FunctionTransformermore lenient by overwriting columns if the output is not consistent with the behaviour ofget_feature_names_out. We were previously raising an error instead but we used this inconsistency within theColumnTransformer.It remains one question: do we want to trigger a copy when setting the columns? I think it is weird that the input
Xget modified once passed in theFunctionTransformer.