8000 FIX: Allow `pipeline` to handle `fit` and `transform` and allows adding `tSNE` by ParthSolanki1 · Pull Request #3 · navn-r/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

FIX: Allow pipeline to handle fit and transform and allows adding tSNE #3

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

Merged
merged 4 commits into from
Mar 6, 2022

Conversation

ParthSolanki1
Copy link
Collaborator
@ParthSolanki1 ParthSolanki1 commented Mar 1, 2022

Reference Issues/PRs

Closes #4

What does this implement/fix? Explain your changes.

Currently, the pipeline feature does not allow users to insert tSNE dimensionality reduction algorithm into a pipeline. This is because it only allows transformers with the "transform" and either one of "fit" or "fit_transform" methods, and since tSNE only has the "fit_transform" method, it fails that sanity test and causes an error. This is done because by adding tSNE to pipeline it makes it essentially a single pass, however, a user should have the option of creating a single pass pipeline.

I fixed this by added a new sanity check, which checked that either "fit_transform" or both "fit" and "transform" are present, which removes this issue and allows users to add tSNE to their pipeline. Rather than an error, we now return a warning that an intermediate step does not have transform.

Any other comments?

I also changed a similar error message which ensured the last estimator in the pipeline may also contain "fit_transform"

@navn-r navn-r changed the title fixed the issue#16710 and created the appropriate tests FIX: Allow pipeline to handle fit and transform and allows adding tSNE Mar 5, 2022
@navn-r navn-r requested a review from tapasrastogi2411 March 5, 2022 18:41
@Samyakk123 Samyakk123 self-requested a review March 6, 2022 19:16
@tapasrastogi2411 tapasrastogi2411 merged commit fd51174 into main Mar 6, 2022
@tapasrastogi2411 tapasrastogi2411 deleted the Issue#16710 branch March 6, 2022 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(#16710) Pipeline requires both fit and transform method to be available instead of only fit_transform
4 participants
0