Warning: This documentation is for scikits.learn version 0.6.0. — Latest stable version

Contents

6.15.1. scikits.learn.pipeline.Pipeline

class scikits.learn.pipeline.Pipeline(steps)

Pipeline of transforms with a final estimator

Sequentialy apply a list of transforms and a final estimator Intermediate steps of the pipeline must be ‘transforms’, that is that they must implements fit & transform methods The final estimator need only implements fit.

The purpose of the pipeline is to assemble several steps that can be cross-validated together while setting different parameters. For this, it enables to setting parameters of the various steps using their names and the parameter name separated by a ‘__’, as in the example below.

Attributes

Methods

fit: Fit all the transforms one after the other and transform the data, then fit the transformed data using the final estimator
fit_transform: Fit all the transforms one after the other and transform the data, then use fit_transform on transformed data using the final estimator. Valid only if the final estimator implements fit_transform.
predict: Applies transforms to the data, and the predict method of the final estimator. Valid only if the final estimator implements predict.
transform: Applies transforms to the data, and the transform method of the final estimator. Valid only if the final estimator implements transform.
score: Applies transforms to the data, and the score method of the final estimator. Valid only if the final estimator implements score.
__init__(steps)
Parameters :

steps: list :

List of (name, transform) object (implementing fit/transform) that are chained, in the order in which they are chained, with the last object an estimator.