Abstract classes¶
- class detroit.scale.Scaler¶
Protocol class which represents Scaler class
- abstractmethod __call__(x: U) V¶
Scales a value.
- Parameters:
x (U) – Value to transform
- Returns:
Scaled value
- Return type:
V
- abstractmethod get_domain() list[U]¶
Returns the domain values.
- Returns:
Domain values
- Return type:
list[U]
- abstractmethod get_range() list[V]¶
Returns the range values.
- Returns:
Range values
- Return type:
list[V]
- class detroit.scale.ContinuousScaler¶
Protocol class which represents Continuous Scaler class
- abstractmethod invert(y: V) U¶
Makes the opposite operation of
__call__.- Parameters:
y (V) – Scaled value
- Returns:
Original value
- Return type:
U
- abstractmethod get_interpolate() Callable[[V, V], Callable[[float], V]]¶
Gets the interpolator function.
- Returns:
Interpolate function
- Return type:
Callable[[V, V], Callable[[float], V]]
- abstractmethod get_clamp() bool¶
Returns if clamp is set on.
- Returns:
Clamp status
- Return type:
bool
- abstractmethod get_unknown() Any¶
Returns the default value when
__call__takes amath.nan.- Returns:
Unknown value
- Return type:
Any
- abstractmethod set_interpolate(interpolate: Callable[[V, V], Callable[[float], V]]) ContinuousScaler[U, V]¶
Sets the interpolator function and returns the scaler updated.
- Parameters:
interpolate (Callable[[V, V], Callable[[float], V]]) – Interpolate function
- Returns:
Itself
- Return type:
ContinuousScaler[U, V]
- abstractmethod set_clamp(clamp: bool) ContinuousScaler[U, V]¶
Sets the clamp status and returns the scaler updated.
- Parameters:
clamp (bool) – Clamp status
- Returns:
Itself
- Return type:
ContinuousScaler[U, V]
- abstractmethod set_unknown(unknown: Any) ContinuousScaler[U, V]¶
Sets the unknown value when a
math.nanis encountered and returns the scaler updated.- Parameters:
unknown (Any) – Unknown value to set
- Returns:
Itself
- Return type:
ContinuousScaler[U, V]
- class detroit.scale.SequentialScaler¶
Protocol class which represents Sequential Scaler class
- abstractmethod set_interpolator(interpolator: Callable[[U], V]) SequentialScaler[U, V]¶
Sets the interpolator function and returns the scaler updated.
- Parameters:
interpolator (Callable[[U], V]) – Interpolator function
- Returns:
Itself
- Return type:
SequentialScaler[U, V]