Introduction to Preprocessing
Sequentia provides a number of useful preprocessing methods for sequential data.
Custom Transformations (
Custom
)Constant Trimming (
TrimConstants
)Min-max Scaling (
MinMaxScale
)Centering (
Center
)Standardizing (
Standardize
)Downsampling (
Downsample
)Filtering (
Filter
)
Additionally, the provided Compose
class makes it possible to apply multiple transformations.
Each of the transformations follow a similar interface, based on the abstract Transform
class:
- class sequentia.preprocessing.Transform[source]
Base class representing a single transformation.
- __call__(X, validate=True)[source]
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:class:numpy:numpy.ndarray (float) or list of
numpy.ndarray
(float) The transformed input observation sequence(s).
- transformed:class:numpy:numpy.ndarray (float) or list of
- transform(x)[source]
Applies the transformation to a single observation sequence.
- Parameters
- X: numpy.ndarray (float)
An individual observation sequence.
- Returns
- transformed:class:numpy:numpy.ndarray (float)
The transformed input 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.
- fit_transform(X, validate=True)[source]
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:class:numpy:numpy.ndarray (float) or list of
numpy.ndarray
(float) The transformed input observation sequence(s).
- transformed:class:numpy:numpy.ndarray (float) or list of