dtoolkit.pipeline.Pipeline.fit#

Pipeline.fit(X, y=None, **params)#

Fit the model.

Fit all the transformers one after the other and sequentially transform the data. Finally, fit the transformed data using the final estimator.

Parameters:
Xiterable

Training data. Must fulfill input requirements of first step of the pipeline.

yiterable, default=None

Training targets. Must fulfill label requirements for all steps of the pipeline.

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

    Parameters passed to the fit method of each step, where each parameter name is prefixed such that parameter p for step s has key s__p.

  • 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.

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.

Returns:
selfobject

Pipeline with fitted steps.