dtoolkit.pipeline.Pipeline.fit_predict#

Pipeline.fit_predict(X, y=None, **params) ndarray | Series[source]#

Transform the data, and apply predict with the final estimator.

Call transform of each transformer in the pipeline. The transformed data are finally passed to the final estimator that calls predict method. Only valid if the final estimator implements predict.

Parameters:
Xiterable

Data to predict on. Must fulfill input requirements of first step of the pipeline.

**paramsdict of str -> object
  • If enable_metadata_routing=False (default):

    Parameters to the predict called at the end of all transformations in the pipeline.

  • If enable_metadata_routing=True:

    Parameters requested and accepted by steps. Each step must have requested certain metadata for these parameters to be forwarded to them.

New in version 0.20.

Changed in version 1.4: Parameters are now passed to the transform method of the intermediate steps as well, if requested, and if enable_metadata_routing=True is set via set_config().

See Metadata Routing User Guide for more details.

Note that while this may be used to return uncertainties from some models with return_std or return_cov, uncertainties that are generated by the transformations in the pipeline are not propagated to the final estimator.

Returns:
y_predndarray

Result of calling predict on the final estimator.