pipefitter.pipeline.Pipeline.fit¶
-
Pipeline.
fit
(table, *args, **kwargs)¶ Train the models using the stages in the pipeline
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 estimators’
fit
method**kwargs : keyword parameters, optional
Any valid keyword parameters to the estimators’
fit
methodReturns: PipelineModel
Notes
Parameters passed in on this method are not persisted on the pipeline. They are only used during the scope of this method.
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]) >>> model = pipe.fit(data)