MaxAbsScaler#

class pyts.preprocessing.MaxAbsScaler[source]#

Scale each sample by its maximum absolute value.

Examples

>>> from pyts.preprocessing import MaxAbsScaler
>>> X = [[1, 5, 3, 2, 10, 6, 4, 7],
...      [1, -5, 3, 2, 2, 1, 0, 2]]
>>> scaler = MaxAbsScaler()
>>> scaler.transform(X)
array([[ 0.1,  0.5,  0.3,  0.2,  1. ,  0.6,  0.4,  0.7],
       [ 0.2, -1. ,  0.6,  0.4,  0.4,  0.2,  0. ,  0.4]])

Methods

__init__()

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 the data.

__init__() → 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 the data.

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.MaxAbsScaler#

Scalers

Scalers