@@ -316,7 +316,7 @@ def fit_resample(self, X, y=None, **fit_params):
316316 return last_step .fit_resample (Xt , yt , ** fit_params )
317317
318318 @if_delegate_has_method (delegate = '_final_estimator' )
319- def predict (self , X ):
319+ def predict (self , X , ** predict_params ):
320320 """Apply transformers/samplers to the data, and predict with the final
321321 estimator
322322
@@ -326,6 +326,14 @@ def predict(self, X):
326326 Data to predict on. Must fulfill input requirements of first step
327327 of the pipeline.
328328
329+ **predict_params : dict of string -> object
330+ Parameters to the ``predict`` called at the end of all
331+ transformations in the pipeline. Note that while this may be
332+ used to return uncertainties from some models with return_std
333+ or return_cov, uncertainties that are generated by the
334+ transformations in the pipeline are not propagated to the
335+ final estimator.
336+
329337 Returns
330338 -------
331339 y_pred : array-like
@@ -339,7 +347,7 @@ def predict(self, X):
339347 pass
340348 else :
341349 Xt = transform .transform (Xt )
342- return self .steps [- 1 ][- 1 ].predict (Xt )
350+ return self .steps [- 1 ][- 1 ].predict (Xt , ** predict_params )
343351
344352 @if_delegate_has_method (delegate = '_final_estimator' )
345353 def fit_predict (self , X , y = None , ** fit_params ):
0 commit comments