module data.preprocessing.sklearn_scaler
Sklearn Scaling Function Wrapper.
This module contains a wrapper for the scikit-learn scaling functions.
Copyright (C) 2022 Johannes Haug.
class SklearnScaler
Wrapper for sklearn scaler functions.
Attributes:
scaler_obj
(Any): A scikit-learn scaler object (e.g. MinMaxScaler)
method SklearnScaler.__init__
__init__(scaler_obj: Any, reset_after_drift: bool = False)
Inits the sklearn scaler.
Args:
scaler_obj
: A scikit-learn scaler object (e.g. MinMaxScaler)reset_after_drift
: A boolean indicating if the scaler will be reset after a drift was detected.
method SklearnScaler.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 SklearnScaler.reset
reset()
Resets the scaler.
We automatically re-fit the scaler upon the next call to partial_fit.
method SklearnScaler.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.