surrogate.pipeline

surrogate.pipeline

Classes

Name Description
Pipeline Pipeline of transforms with a final estimator.

Pipeline

surrogate.pipeline.Pipeline(steps)

Pipeline of transforms with a final estimator.

Sequentially apply a list of transforms and a final estimator. This simple implementation assumes that all steps except the last one are transformers (have fit_transform or fit+transform), and the last step is an estimator (has fit and predict).

Parameters

Name Type Description Default
steps list List of (name, transform) tuples (implementing fit/transform) that are chained, in the order they are chained, with the last object an estimator. required

Methods

Name Description
fit Fit the model.
predict Transform the data, and apply predict with the final estimator.
fit
surrogate.pipeline.Pipeline.fit(X, y=None, **fit_params)

Fit the model.

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

Parameters
Name Type Description Default
X iterable Training data. Must fulfill input requirements of first step of the pipeline. required
y iterable Training targets. Must fulfill label requirements for all steps of the pipeline. None
**fit_params Any Additional parameters passed to the fit method of the final estimator. {}
Returns
Name Type Description
Pipeline Pipeline Pipeline with fitted steps.
predict
surrogate.pipeline.Pipeline.predict(X, **predict_params)

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

Parameters
Name Type Description Default
X iterable Data to predict on. Must fulfill input requirements of first step of the pipeline. required
**predict_params Any Additional parameters passed to the predict method of the final estimator. {}
Returns
Name Type Description
Any Any Result of calling predict on the final estimator.