sktime.transformations: Time series transformers

The sktime.transformations module contains classes for data transformations.

Panel transformers

Dictionary-based

PAA([num_intervals])

(PAA) Piecewise Aggregate Approximation Transformer, as described in Eamonn Keogh, Kaushik Chakrabarti, Michael Pazzani, and Sharad Mehrotra.

SFA([word_length, alphabet_size, …])

SFA (Symbolic Fourier Approximation) Transformer, as described in

SAX([word_length, alphabet_size, …])

SAX (Symbolic Aggregate approXimation) Transformer, as described in Jessica Lin, Eamonn Keogh, Li Wei and Stefano Lonardi, “Experiencing SAX: a novel symbolic representation of time series” Data Mining and Knowledge Discovery, 15(2):107-144 Overview: for each series: run a sliding window across the series for each window shorten the series with PAA (Piecewise Approximate Aggregation) discretise the shortened series into fixed bins form a word from these discrete values by default SAX produces a single word per series (window_size=0). SAX returns a pandas data frame where column 0 is the histogram (sparse pd.series) of each series.

Summarize

DerivativeSlopeTransformer()

PlateauFinder([value, min_length])

Transformer that finds segments of the same given value, plateau in the time series, and returns the starting indices and lengths.

RandomIntervalFeatureExtractor([…])

Transformer that segments time-series into random intervals and subsequently extracts series-to-primitives features from each interval.

FittedParamExtractor(forecaster, param_names)

Extract parameters of a fitted forecaster as features for a subsequent tabular learning task.

tsfresh

TSFreshRelevantFeatureExtractor([…])

Transformer for extracting and selecting features.

TSFreshFeatureExtractor([…])

Transformer for extracting time series features

Catch22

Catch22()

Canonical Time-series Characteristics (catch22)

Compose

ColumnTransformer(transformers[, remainder, …])

Applies transformations to columns of an array or pandas DataFrame.

ColumnConcatenator()

Transformer that concatenates multivariate time series/panel data into long univariate time series/panel data by simply concatenating times series in time.

SeriesToSeriesRowTransformer(transformer[, …])

SeriesToPrimitivesRowTransformer(transformer)

make_row_transformer(transformer[, …])

Factory function for creating InstanceTransformer based on transform type

Matrix profile

MatrixProfile([m])

Takes as input a time series dataset and returns the matrix profile and index profile for each time series of the dataset.

PCA

PCATransformer([n_components])

Transformer that applies Principle Components Analysis to a univariate time series.

Reduce

Tabularizer()

A transformer that turns time series/panel data into tabular data.

Rocket

Rocket([num_kernels, normalise, random_state])

ROCKET

MiniRocket([num_features, …])

MINIROCKET

MiniRocketMultivariate([num_features, …])

MINIROCKET (Multivariate)

Segment

IntervalSegmenter([intervals])

Interval segmentation transformer.

RandomIntervalSegmenter([n_intervals, …])

Transformer that segments time-series into random intervals with random starting points and lengths.

Shapelet

ShapeletTransform([min_shapelet_length, …])

Shapelet Transform.

ContractedShapeletTransform([…])

Contracted Shapelet Transform. @incollection{bostrom2017binary, title={Binary shapelet transform for multiclass time series classification}, author={Bostrom, Aaron and Bagnall, Anthony}, booktitle={Transactions on Large-Scale Data-and Knowledge-Centered Systems XXXII}, pages={24–46}, year={2017}, publisher={Springer} }.

Series transformers

Detrend

Detrender(forecaster)

Remove a trend from a series.

Deseasonalizer([sp, model])

A transformer that removes a seasonal and trend components from time series

ConditionalDeseasonalizer([…])

A transformer that removes a seasonal and trend components from time series, conditional on seasonality test.

Adapt

TabularToSeriesAdaptor(transformer)

Adaptor for scikit-learn-like tabular transformations to series setting.

Box-cox

BoxCoxTransformer([bounds, method])

LogTransformer()

Auto-correlation

AutoCorrelationTransformer([adjusted, …])

Auto-correlation transformer.

PartialAutoCorrelationTransformer([n_lags, …])

Partial auto-correlation transformer.

Matrix Profile

MatrixProfileTransformer([window_length])

Imputer

Imputer(method[, random_state, value, …])

Missing value imputation

HampelFilter

HampelFilter(window_length[, n_sigma, k, …])

HampelFilter to detect outliers based on a sliding window.