pipefitter.pipeline.Pipeline.transform

Pipeline.transform(table, *args, **kwargs)

Execute the transformations in this pipeline only

Parameters:

table : data set

Any data set object supported by the transformers and estimators in the pipeline stages

*args : positional parameters, optional

Any valid parameters to the transformers’ transform method

**kwargs : keyword parameters, optional

Any valid keyword parameters to the transformers’ transform method

Returns:

data set

The same type of data set as passed in table

Notes

When the pipeline contains estimators, they typically just pass the input table on to the next stage of the pipeline.

Examples

Basic pipeline fit using imputers and an estimator:

>>> mean_imp = Imputer(Imputer.MEAN)
>>> mode_imp = Imputer(Imputer.MODE)
>>> dtree = DecisionTree(target='Origin',
...                      nominals=['Type', 'Cylinders', 'Origin'],
...                      inputs=['MPG_City', 'MPG_Highway', 'Length',
...                              'Weight', 'Type', 'Cylinders'])
>>> pipe = Pipeline([mean_imp, mode_imp, dtree])
>>> new_table = pipe.transform(data)