module data.preprocessing.base_scaler
Base Scaler.
This module encapsulates functionality to scale, i.e. normalize, streaming observations. The abstract BaseScaler should be used to implement custom scaling methods. A scaler object can be provided to the data loader object.
Copyright (C) 2022 Johannes Haug.
class BaseScaler
Abstract Base Class for online data scaling.
Attributes:
reset_after_drift
(bool): A boolean indicating if the scaler will be reset after a drift was detected.
method BaseScaler.__init__
__init__(reset_after_drift: bool)
Initializes the data scaler.
Args:
reset_after_drift
: A boolean indicating if the scaler will be reset after a drift was detected.
method BaseScaler.partial_fit
partial_fit(
X: Union[numpy._array_like._SupportsArray[numpy.dtype], numpy._nested_sequence._NestedSequence[numpy._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]
)
Updates the scaler.
Args:
X
: Array/matrix of observations.
method BaseScaler.reset
reset()
Resets the scaler.
method BaseScaler.transform
transform(
X: Union[numpy._array_like._SupportsArray[numpy.dtype], numpy._nested_sequence._NestedSequence[numpy._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]
) → Union[numpy._array_like._SupportsArray[numpy.dtype], numpy._nested_sequence._NestedSequence[numpy._array_like._SupportsArray[numpy.dtype]], bool, int, float, complex, str, bytes, numpy._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]
Scales the given observations.
Args:
X
: Array/matrix of observations.
Returns:
ArrayLike
: The scaled observations.
This file was automatically generated via lazydocs.