Min-max Scaling (MinMaxScale)

API reference

class sequentia.preprocessing.MinMaxScale(scale=(0.0, 1.0), independent=True)[source]

Scales the observation sequence features to each be within a provided range.

Parameters
scale: tuple(int/float, int/float)

The range of the transformed observation sequence features.

independent: bool

Whether to independently compute the minimum and maximum to scale each observation sequence.

fit(X, validate=True)[source]

Fit the transformation on the provided observation sequence(s) (without transforming them).

Parameters
X: numpy.ndarray (float) or list of numpy.ndarray (float)

An individual observation sequence or a list of multiple observation sequences.

validate: bool

Whether or not to validate the input sequences.

transform(x)[source]

Applies the transformation to a single observation sequence.

Parameters
X: numpy.ndarray (float)

An individual observation sequence.

Returns
transformed: numpy.ndarray (float)

The transformed input observation sequence.

is_fitted()[source]

Check whether or not the transformation is fitted on some observation sequence(s).

Returns
fitted: bool

Whether or not the transformation is fitted.

unfit()[source]

Unfit the transformation by resetting the parameters to their default settings.

fit_transform(X, validate=True)

Fit the transformation with the provided observation sequence(s) and transform them.

Parameters
X: numpy.ndarray (float) or list of numpy.ndarray (float)

An individual observation sequence or a list of multiple observation sequences.

validate: bool

Whether or not to validate the input sequences.

Returns
transformed: numpy.ndarray (float) or list of numpy.ndarray (float)

The transformed input observation sequence(s).

__call__(X, validate=True)

Applies the transformation to the observation sequence(s).

Parameters
X: numpy.ndarray (float) or list of numpy.ndarray (float)

An individual observation sequence or a list of multiple observation sequences.

validate: bool

Whether or not to validate the input sequences.

Returns
transformed: numpy.ndarray (float) or list of numpy.ndarray (float)

The transformed input observation sequence(s).