@@ -716,8 +716,11 @@ is not met, an exception of type ``ValueError`` should be raised.
716
716
``y `` might be ignored in the case of unsupervised learning. However, to
717
717
make it possible to use the estimator as part of a pipeline that can
718
718
mix both supervised and unsupervised transformers, even unsupervised
719
- estimators are kindly asked to accept a ``y=None `` keyword argument in
719
+ estimators need to accept a ``y=None `` keyword argument in
720
720
the second position that is just ignored by the estimator.
721
+ For the same reason, ``fit_predict ``, ``fit_transform ``, ``score ``,
722
+ ``transform `` and ``partial_fit `` methods need to accept a ``y `` argument in
723
+ the second place if they are implemented.
721
724
722
725
The method should return the object (``self ``). This pattern is useful
723
726
to be able to implement quick one liners in an IPython session such as::
@@ -857,9 +860,10 @@ last step, it needs to provide a ``fit`` or ``fit_transform`` function.
857
860
To be able to evaluate the pipeline on any data but the training set,
858
861
it also needs to provide a ``transform `` function.
859
862
There are no special requirements for the last step in a pipeline, except that
860
- it has a ``fit `` function. All ``fit `` and ``fit_transform `` functions must
861
- take arguments ``X, y ``, even if y is not used.
862
-
863
+ it has a ``fit `` function. All ``fit `` and ``fit_transform `` functions must
864
+ take arguments ``X, y ``, even if y is not used. Similarly, for ``score `` to be
865
+ usable, the last step of the pipeline needs to have a ``score `` function that
866
+ accepts an optional ``y ``.
863
867
864
868
Working notes
865
869
-------------
0 commit comments