[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH implement metadata routing in Pipeline #26789

Merged
merged 11 commits into from
Jul 13, 2023

Conversation

adrinjalali
Copy link
Member
@adrinjalali adrinjalali commented Jul 6, 2023

Towards #22893

This adds metadata routing to pipeline.

Closes #21134
Closes #18159
Closes #24507

@github-actions
Copy link
github-actions bot commented Jul 6, 2023

✔️ Linting Passed

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

Generated for commit: 85583cd. Link to the linter CI: here

@adrinjalali
Copy link
Member Author

@thomasjpfan @glemaitre this should also be ready for a review

@adrinjalali
Copy link
Member Author

@OmarManzoor I'd also appreciate your feedback on this.

sklearn/pipeline.py Outdated Show resolved Hide resolved
Copy link
Contributor
@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@glemaitre glemaitre self-requested a review July 12, 2023 13:49
Copy link
Member
@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

Looks good on my side. Just if we could a couple of test for the uncovered lines.

try:
getattr(pipeline, method)([[1]], [1], sample_weight=[1], prop="a")
except TypeError:
getattr(pipeline, method)([[1]], sample_weight=[1], prop="a")
Copy link
Member

Choose a reason for hiding this comment

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

We should mention why we bypass the TypeError. I assume this is for estimators that only accept X?

Copy link
Member Author

Choose a reason for hiding this comment

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

not estimators, methods. fit takes X, y, while predict takes only X. I'll add a comment.

sklearn/tests/test_pipeline.py Outdated Show resolved Hide resolved
sklearn/pipeline.py Outdated Show resolved Hide resolved
sklearn/pipeline.py Outdated Show resolved Hide resolved
sklearn/pipeline.py Outdated Show resolved Hide resolved
sklearn/pipeline.py Show resolved Hide resolved
sklearn/pipeline.py Outdated Show resolved Hide resolved
sklearn/pipeline.py Outdated Show resolved Hide resolved
sklearn/pipeline.py Outdated Show resolved Hide resolved
sklearn/pipeline.py Show resolved Hide resolved
Copy link
Member Author
@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

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

This should address your comments now @glemaitre

try:
getattr(pipeline, method)([[1]], [1], sample_weight=[1], prop="a")
except TypeError:
getattr(pipeline, method)([[1]], sample_weight=[1], prop="a")
Copy link
Member Author

Choose a reason for hiding this comment

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

not estimators, methods. fit takes X, y, while predict takes only X. I'll add a comment.

Copy link
Member
@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM

@glemaitre glemaitre merged commit 4bcd6ea into scikit-learn:main Jul 13, 2023
28 checks passed
@adrinjalali adrinjalali deleted the slep6/pipeline branch July 14, 2023 09:47
punndcoder28 pushed a commit to punndcoder28/scikit-learn that referenced this pull request Jul 29, 2023
REDVM pushed a commit to REDVM/scikit-learn that referenced this pull request Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants