simpleml.pipelines.external_pipelines

Base class for standardized pipeline methods

Module Contents

Classes

ExternalPipelineMixin

Mixin to add unimplemented stubs for standardized api

Attributes

__author__

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

Bases: object

Mixin to add unimplemented stubs for standardized api

abstract add_transformer(self, name, transformer)[source]

Setter method for new transformer step

Parameters
  • name (str) –

  • transformer (Any) –

Return type

None

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

Iterate through each transformation step and apply fit

Parameters
  • X (Any) –

  • y (Optional[Any]) –

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

Iterate through each transformation step and apply fit and transform

Parameters
  • X (Any) –

  • y (Optional[Any]) –

Return type

Any

abstract 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[str]) – list of initial feature names before transformations

Type

list

Return type

List[str]

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

Iterate through transformers and return parameters

Parameters

params_only (Optional[bool]) – Unused parameter to align signature with Sklearn version

Return type

Dict[str, Any]

abstract get_transformers(self)[source]

Get list of (step, transformer) tuples

Return type

List[Tuple[str, str]]

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

Iterate through each transformation step and apply partial fit

Parameters
  • X (Any) –

  • y (Optional[Any]) –

abstract remove_transformer(self, name)[source]

Delete method for transformer step

Parameters

name (str) –

Return type

None

abstract reset(self)[source]

Command to reset any saved state in the transformers. Expects each transformer to implement if there is any partial state (e.g. partial_fit called)

Return type

None

abstract 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

Return type

None

a transformer step

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

Iterate through each transformation step and apply transform

Parameters

X (Any) –

Return type

Any