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.

__init__(sample_range: tuple[float, float] = (0, 1)) → None[source]#
fit(X: ArrayLike | None = None, y: ArrayLike | None = None) → Self[source]#

Pass.

Parameters:
X

Ignored

y

Ignored

Returns:
selfobject
transform(X: ArrayLike) → NDArray[float64][source]#

Scale samples of X according to sample_range.

Parameters:
Xarray-like, shape = (n_samples, n_timestamps)

Data to scale.

Returns:
X_newarray-like, shape = (n_samples, n_timestamps)

Scaled data.

Examples using pyts.preprocessing.MinMaxScaler#

Scalers

Scalers