8000 Try to fix linting pb · scikit-learn/scikit-learn@0a6edc9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0a6edc9

Browse files
Try to fix linting pb
1 parent 3b294b2 commit 0a6edc9

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

doc/modules/manifold.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ version, the algorithms will try to preserve the order of the distances, and
417417
hence seek for a monotonic relationship between the distances in the embedded
418418
space and the similarities/dissimilarities.
419419

420-
.. figure:: ../auto_examples/manifold/images/sphx_glr_plot_lle_digits_010.png
420+
.. figure:: ../auto_examples/manifold/images/sphx_glr_plot_lle_digits_002.png
421421
:target: ../auto_examples/manifold/plot_lle_digits.html
422422
:align: center
423423
:scale: 50

sklearn/pipeline.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ def __init__(self, steps, *, memory=None, verbose=False):
146146
self.steps = steps
147147
self.memory = memory
148148
self.verbose = verbose
149-
self._validate_steps()
150149

151150
def get_params(self, deep=True):
152151
"""Get parameters for this estimator.
@@ -202,14 +201,12 @@ def _validate_steps(self):
202201
for t in transformers:
203202
if t is None or t == "passthrough":
204203
continue
205-
if (not hasattr(t, "fit_transform") and
206-
(not hasattr(t, "fit") and hasattr(t, "transform"))):
207-
raise TypeError(
208-
"All intermediate steps should be "
209-
"transform, fit_transform or be the string "
210-
"'passthrough'. '%s' (type %s) doesn't"
211-
% (t, type(t))
212-
)
204+
if (not (hasattr(t, "fit") or hasattr(t, "fit_transform")) or not
205+
hasattr(t, "transform")):
206+
raise TypeError("All intermediate steps should be "
207+
"transformers and implement fit and transform "
208+
"or be the string 'passthrough' "
209+
"'%s' (type %s) doesn't" % (t, type(t)))
213210

214211
# We allow last estimator to be None as an identity transformation
215212
if (
@@ -218,10 +215,9 @@ def _validate_steps(self):
218215
and not hasattr(estimator, "fit")
219216
):
220217
raise TypeError(
221-
"Last step of Pipeline should implement fit, "
222-
"fit_transform or be the string 'passthrough'. "
223-
"'%s' (type %s) doesn't" % (estimator, type(estimator))
224-
)
218+
"Last step of Pipeline should implement fit "
219+
"or be the string 'passthrough'. "
220+
"'%s' (type %s) doesn't" % (estimator, type(estimator)))
225221

226222
def _iter(self, with_final=True, filter_passthrough=True):
227223
"""

0 commit comments

Comments
 (0)
0