simpleml.transformers.base_transformer

Module Contents

Classes

Transformer

Base Transformer class with param management - Can interfere with mro

TransformerMixin

Base Transformer class that implements all the necessary methods

Attributes

__author__

simpleml.transformers.base_transformer.__author__ = Elisha Yadgaran[source]
class simpleml.transformers.base_transformer.Transformer(**kwargs)[source]

Bases: TransformerMixin

Base Transformer class with param management - Can interfere with mro if used as a mixin - Use TransformerMixin in that case

Assumes only seeding kwargs passed - will affect hash otherwise if random unused parameters are passed

get(self, param)[source]
Parameters

param (str) –

Return type

Any

get_params(self, **kwargs)[source]

Should only return seeding parameters, not fit ones (ie params of unfit object should be identical to fit object)

Return type

Dict[str, Any]

set_params(self, **kwargs)[source]
Return type

None

class simpleml.transformers.base_transformer.TransformerMixin[source]

Bases: sklearn.base.TransformerMixin

Base Transformer class that implements all the necessary methods

Default behavior is to do nothing - overwrite later

object_type :str = TRANSFORMER[source]
fit(self, X, y=None, **kwargs)[source]
Parameters
  • X (Any) –

  • y (Optional[Any]) –

get_feature_names(self, input_feature_names)[source]
Parameters

input_feature_names (List[str]) –

Return type

List[str]

get_params(self, **kwargs)[source]

Should only return seeding parameters, not fit ones (ie params of unfit object should be identical to fit object)

Return type

Dict[str, Any]

abstract partial_fit(self, X, y=None, **kwargs)[source]
Parameters
  • X (Any) –

  • y (Optional[Any]) –

abstract reset(self)[source]

Flag to reset state to initialized values. Expects subclasses to implement

Return type

None

set_params(self, **kwargs)[source]
Return type

None

transform(self, X, y=None, **kwargs)[source]
Parameters
  • X (Any) –

  • y (Optional[Any]) –

Return type

Any