8000 Allow the creation of a pipeline for non-parametric functions like TSNE by cathelineparisot · Pull Request #22162 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

Allow the creation of a pipeline for non-parametric functions like TSNE #22162

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/modules/manifold.rst
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ version, the algorithms will try to preserve the order of the distances, and
hence seek for a monotonic relationship between the distances in the embedded
space and the similarities/dissimilarities.

.. figure:: ../auto_examples/manifold/images/sphx_glr_plot_lle_digits_010.png
.. figure:: ../auto_examples/manifold/images/sphx_glr_plot_lle_digits_002.png
:target: ../auto_examples/manifold/plot_lle_digits.html
:align: center
:scale: 50
Expand Down
18 changes: 7 additions & 11 deletions sklearn/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,12 @@ def _validate_steps(self):
for t in transformers:
if t is None or t == "passthrough":
continue
if not (hasattr(t, "fit") or hasattr(t, "fit_transform")) or not hasattr(
t, "transform"
):
raise TypeError(
"All intermediate steps should be "
"transformers and implement fit and transform "
"or be the string 'passthrough' "
"'%s' (type %s) doesn't" % (t, type(t))
)
if (not (hasattr(t, "fit") or hasattr(t, "fit_transform")) or not
hasattr(t, "transform")):
raise TypeError("All intermediate steps should be "
"transformers and implement fit and transform "
"or be the string 'passthrough' "
"'%s' (type %s) doesn't" % (t, type(t)))

# We allow last estimator to be None as an identity transformation
if (
Expand All @@ -220,8 +217,7 @@ def _validate_steps(self):
raise TypeError(
"Last step of Pipeline should implement fit "
"or be the string 'passthrough'. "
"'%s' (type %s) doesn't" % (estimator, type(estimator))
)
"'%s' (type %s) doesn't" % (estimator, type(estimator)))

def _iter(self, with_final=True, filter_passthrough=True):
"""
Expand Down
0