MinMaxScaler#
- class pyts.preprocessing.MinMaxScaler(sample_range: tuple[float, float] = (0, 1))[source]#
Transforms samples by scaling each sample to a given range.
- Parameters:
- sample_rangetuple (min, max) (default = (0, 1))
Desired range of transformed data.
Examples
>>> from pyts.preprocessing import MinMaxScaler >>> X = [[1, 5, 3, 2, 9, 6, 4, 7], ... [1, -2, 3, 2, 2, 1, 0, 2]] >>> scaler = MinMaxScaler() >>> scaler.transform(X) array([[0. , 0.5 , 0.25 , 0.125, 1. , 0.625, 0.375, 0.75 ], [0.6 , 0. , 1. , 0.8 , 0.8 , 0.6 , 0.4 , 0.8 ]])
Methods
__init__([sample_range])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_output(*[, transform])Set output container.
set_params(**params)Set the parameters of this estimator.
transform(X)Scale samples of X according to sample_range.