diff --git a/doc/modules/manifold.rst b/doc/modules/manifold.rst index e6e8e842fa7fc..54e052dd2d614 100644 --- a/doc/modules/manifold.rst +++ b/doc/modules/manifold.rst @@ -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 diff --git a/sklearn/pipeline.py b/sklearn/pipeline.py index 794919f6942e1..6561408e91a65 100644 --- a/sklearn/pipeline.py +++ b/sklearn/pipeline.py @@ -201,6 +201,18 @@ def _validate_steps(self): for t in transformers: if t is None or t == "passthrough": continue +<<<<<<< HEAD +<<<<<<< HEAD + if (not hasattr(t, "fit_transform") and + (not hasattr(t, "fit") and hasattr(t, "transform"))): + raise TypeError("All intermediate steps should be " + "transformers and implement fit and " + "transform, fit_transform or be the string " + "'passthrough'. '%s' (type %s) doesn't" + % (t, type(t))) +======= +======= +>>>>>>> parent of 3b294b20d... [fix]allow-when-only-fit-transform if not (hasattr(t, "fit") or hasattr(t, "fit_transform")) or not hasattr( t, "transform" ): @@ -210,6 +222,7 @@ def _validate_steps(self): "or be the string 'passthrough' " "'%s' (type %s) doesn't" % (t, type(t)) ) +>>>>>>> parent of 3b294b20d... [fix]allow-when-only-fit-transform # We allow last estimator to be None as an identity transformation if ( @@ -218,10 +231,19 @@ def _validate_steps(self): and not hasattr(estimator, "fit") ): raise TypeError( +<<<<<<< HEAD +<<<<<<< HEAD + "Last step of Pipeline should implement fit, " + "fit_transform or be the string 'passthrough'. " + "'%s' (type %s) doesn't" % (estimator, type(estimator))) +======= +======= +>>>>>>> parent of 3b294b20d... [fix]allow-when-only-fit-transform "Last step of Pipeline should implement fit " "or be the string 'passthrough'. " "'%s' (type %s) doesn't" % (estimator, type(estimator)) ) +>>>>>>> parent of 3b294b20d... [fix]allow-when-only-fit-transform def _iter(self, with_final=True, filter_passthrough=True): """