ENH Expose verbose_feature_names_out in make_union#30406
Merged
OmarManzoor merged 6 commits intoscikit-learn:mainfrom Jan 13, 2025
Merged
Conversation
Signed-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>
Signed-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>
thomasjpfan
reviewed
Dec 5, 2024
Member
There was a problem hiding this comment.
Thank you for the PR @Ethan0456 !
- Can you add a test to
sklearn/tests/test_pipeline.py? - Also add a whats new in
doc/whats_new/upcoming_changes/sklearn.pipeline/30406.enhancement.rst. You can follow the pattern that directory to see how to create new entry.
…t in make_union - Added a test case to validate the `verbose_feature_names_out` argument in `make_union`, including handling of duplicate feature names. - Added an enhancement entry in `doc/whats_new/upcoming_changes/sklearn.pipeline/30406.enhancement.rst`. References scikit-learn#30364 Signed-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>
Signed-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>
thomasjpfan
reviewed
Dec 6, 2024
| return mock | ||
|
|
||
|
|
||
| def test_make_union_verbose_feature_names_out_enabled(): |
Member
There was a problem hiding this comment.
Since, we already have similar test for FeatureUnion. I think it's enough to test that make_union sets verbose_feature_names_out correctly. Something like this:
def test_make_union_passes_verbose_feature_names_out():
union = make_union(..., verbose_feature_names_out=False)
assert not union.verbose_feature_names_out
Contributor
Author
There was a problem hiding this comment.
Hi @thomasjpfan,
I've simplified the test case in my recent commit. Could you please review it when you get a chance?
Thanks!
Signed-off-by: Abhijeetsingh Meena <abhijeet040403@gmail.com>
OmarManzoor
reviewed
Dec 30, 2024
Contributor
OmarManzoor
left a comment
There was a problem hiding this comment.
Thanks for the PR @Ethan0456
OmarManzoor
approved these changes
Jan 13, 2025
Contributor
OmarManzoor
left a comment
There was a problem hiding this comment.
LGTM. Thanks @Ethan0456
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.
Reference Issues/PRs
Fixes #30364
What does this implement/fix? Explain your changes.
This PR exposes the
verbose_feature_names_outargument in themake_unionfunction. It allows users to control feature name uniqueness in theFeatureUnionby enabling or disabling automatic name prefixing, which helps in managing feature name collisions more effectively.Any other comments?
No additional comments.