simpleml.pipelines.external_pipelines

Wrapper class for a pickleable pipeline of a series of transformers

Module Contents

Classes

DefaultPipeline

Use default dictionary behavior but add wrapper methods for

SklearnPipeline

Use default sklearn behavior but add wrapper methods for

simpleml.pipelines.external_pipelines.__author__ = Elisha Yadgaran[source]
class simpleml.pipelines.external_pipelines.DefaultPipeline[source]

Bases: collections.OrderedDict

Use default dictionary behavior but add wrapper methods for extended functionality

Initialize self. See help(type(self)) for accurate signature.

add_transformer(self, name, transformer)[source]

Setter method for new transformer step

fit(self, X, y=None, **kwargs)[source]

Iterate through each transformation step and apply fit

fit_transform(self, X, y=None, **kwargs)[source]

Iterate through each transformation step and apply fit and transform

get_feature_names(self, feature_names)[source]

Iterate through each transformer and return list of resulting features starts with empty list by default but can pass in dataset as starting point to guide transformations

Parameters

feature_names – list of initial feature names before transformations

Type

list

get_params(self, params_only=None, **kwargs)[source]

Iterate through transformers and return parameters

Parameters

params_only – Unused parameter to align signature with Sklearn version

get_transformers(self)[source]

Get list of (step, transformer) tuples

remove_transformer(self, name)[source]

Delete method for transformer step

set_params(self, **params)[source]

Set params for transformers. Input is expected to be dict of dict

Parameters

params – dictionary of dictionaries. each dictionary must map to

a transformer step

transform(self, X, **kwargs)[source]

Iterate through each transformation step and apply transform

class simpleml.pipelines.external_pipelines.SklearnPipeline(steps, *, memory=None, verbose=False)[source]

Bases: sklearn.pipeline.Pipeline

Use default sklearn behavior but add wrapper methods for extended functionality

add_transformer(self, name, transformer, index=None)[source]

Setter method for new transformer step

get_feature_names(self, feature_names)[source]

Iterate through each transformer and return list of resulting features starts with empty list by default but can pass in dataset as starting point to guide transformations

Parameters

feature_names – list of initial feature names before transformations

Type

list

get_params(self, params_only=False, **kwargs)[source]

Wrapper around sklearn implementation to drop non parameter returns :param params_only: boolean to filter down to actual transformer parameters

get_transformers(self)[source]

Get list of (step, transformer) tuples

remove_transformer(self, name)[source]

Delete method for transformer step