StandardScaler#
- class pyts.preprocessing.StandardScaler(with_mean: bool = True, with_std: bool = True)[source]#
Standardize time series by removing mean and scaling to unit variance.
- Parameters:
- with_meanbool (default = True)
If True, center the data before scaling.
- with_stdbool (default = True)
If True, scale the data to unit variance.
Examples
>>> from pyts.preprocessing import StandardScaler >>> X = [[0, 2, 0, 4, 4, 6, 4, 4], ... [1, 0, 3, 2, 2, 2, 0, 2]] >>> scaler = StandardScaler() >>> scaler.transform(X) array([[-1.5, -0.5, -1.5, 0.5, 0.5, 1.5, 0.5, 0.5], [-0.5, -1.5, 1.5, 0.5, 0.5, 0.5, -1.5, 0.5]])
Methods
__init__([with_mean, with_std])fit([X, y])Pass.
fit_transform(X[, y])Fit to data, then transform it.
get_metadata_routing()Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
set_params(**params)Set the parameters of this estimator.
transform(X)Perform standardization by centering and scaling.