spines.transforms¶
Transforms subpackage for spines.
-
class
spines.transforms.Transform(*args, **kwargs)[source]¶ Bases:
spines.core.base.BaseObjectBase Transform class
-
construct(*args, **kwargs) → None[source]¶ Constructs the transformer prior to use
- Parameters
args (optional) – Arguments to use in constructing the transformer.
kwargs (optional) – Keyword arguments to use in constructing the transformer.
-
fit(*args, **kwargs) → Union[None, Dict[KT, VT]][source]¶ Fits the parameters for this transformation
- Parameters
args – Data to use for fitting this Transformer.
kwargs (optional) – Additional keyword-arguments to use in fit call.
- Returns
Dictionary of updates from fit, or
None.- Return type
dictorNone
-
score(*args, **kwargs) → float[source]¶ Returns the score measure for this Transform
- Parameters
args (optional) – Arguments (data inputs and outputs) to pass to the score call.
kwargs (optional) – Additional keyword-arguements to pass to the score call.
- Returns
Score for the given inputs and outputs.
- Return type
float
-
-
class
spines.transforms.Pass(*args, **kwargs)[source]¶ Bases:
spines.transforms.base.TransformTransform which simply passes the given values through
-
output¶ Parameter class
- Parameters
value_type (
typeorIterableoftype) – The type(s) of values allowed for this parameter.default (object, optional) – Default value for this parameter, if any.
desc (str, optional) – Description for this parameter, if any.
-
transform(*args, **kwargs)[source]¶ Passes the given input args back out
If this transform’s output parameter is set, it will attempt to call it’s
__call__with the given args and kwargs. If no output parameter is set this will return the input args as atupleif they have a length greater than one otherwise it will just return the first input element of args.- Parameters
args – Input data to pass back out.
kwargs (optional) – Additional keyword arguments to use if output parameter is set.
-
Submodules