Transformations#

The aeon.transformations module contains classes for data transformations.

Transformations.

All (simple) transformers in aeon can be listed using the aeon.registry .all_estimators utility, using estimator_types=”transformer” tag.

Transformations are categorized as follows:

Category

Explanation

Example

Composition

Building blocks for pipelines, wrappers, adapters

Transformer pipeline

Series-to-tabular

Transforms series to tabular data

Length and mean

series-to-series

Transforms individual series to series

Differencing, detrending

Series-to-collection

transforms a series into a collection of time series

Bootstrap, sliding window

Collection

Transforms a collection of times series into a new collection of time series

Padding to equal length

Hierarchical

uses hierarchy information non-trivially

Reconciliation

Composition#

Pipeline building#

TransformerPipeline(steps)

Pipeline of transformers compositor.

FeatureUnion(transformer_list[, n_jobs, ...])

Concatenates results of multiple transformer objects.

ColumnwiseTransformer(transformer[, columns])

Apply a transformer columnwise to multivariate series.

FitInTransform(transformer[, ...])

Transformer wrapper to delay fit to the transform phase.

MultiplexTransformer(transformers[, ...])

Facilitate an AutoML based selection of the best transformer.

OptionalPassthrough(transformer[, passthrough])

Wrap an existing transformer to tune whether to include it in a pipeline.

InvertTransform(transformer)

Invert a series-to-series transformation.

Id([_output_convert])

Identity transformer, returns data unchanged in transform/inverse_transform.

YtoX([subset_index])

Create exogeneous features which are a copy of the endogenous data.

FunctionTransformer([func, inverse_func, ...])

Constructs a transformer from an arbitrary callable.

Sklearn and pandas adapters#

Tabularizer()

A transformer that turns time series collection into tabular data.

TabularToSeriesAdaptor(transformer[, ...])

Adapt scikit-learn transformation interface to time series setting.

PandasTransformAdaptor(method[, kwargs, ...])

Adapt pandas transformations to aeon interface.

Series-to-tabular transformers#

Series-to-tabular transformers transform individual time series to a vector of features, usually a vector of floats, but can also be categorical.

When applied to collections or hierarchical data, the transformation result is a table with as many rows as time series in the collection and a column for each feature.

Summarization#

These transformers extract simple summary features.

SummaryTransformer([summary_function, ...])

Calculate summary value of a time series.

WindowSummarizer([lag_feature, n_jobs, ...])

Transformer for extracting time series features.

FittedParamExtractor(forecaster, param_names)

Fitted parameter extractor.

Shapelets, wavelets and convolution#

RandomShapeletTransform([...])

Random Shapelet Transform.

RandomDilatedShapeletTransform([...])

Random Dilated Shapelet Transform (RDST) as described in [R1a26faa97573-1]_[R1a26faa97573-2]_.

SAST([lengths, stride, nb_inst_per_class, ...])

Scalable and Accurate Subsequence Transform (SAST).

Rocket([num_kernels, normalise, n_jobs, ...])

RandOm Convolutional KErnel Transform (ROCKET).

MiniRocket([num_kernels, ...])

MINImally RandOm Convolutional KErnel Transform (MiniRocket).

MiniRocketMultivariate([num_kernels, ...])

MINImally RandOm Convolutional KErnel Transform (MiniRocket) multivariate.

MiniRocketMultivariateVariable([...])

MINIROCKET (Multivariate, unequal length).

MultiRocket([num_kernels, ...])

Multi RandOm Convolutional KErnel Transform (MultiRocket).

MultiRocketMultivariate([num_kernels, ...])

Multi RandOm Convolutional KErnel Transform (MultiRocket).

DWTTransformer([n_levels])

Discrete Wavelet Transform Transformer.

Distance-based features#

MatrixProfile([m])

Return the matrix profile and index profile for each time series of a dataset.

Dictionary-based features#

PAA([n_segments])

Piecewise Aggregate Approximation Transformer (PAA).

SFA([word_length, alphabet_size, ...])

Symbolic Fourier Approximation (SFA) Transformer.

SAX([n_segments, alphabet_size, ...])

Symbolic Aggregate approXimation (SAX) transformer.

Signature-based features#

SignatureTransformer([augmentation_list, ...])

Transformation class from the signature method.

Feature collections#

These transformers extract larger collections of features.

TSFreshRelevantFeatureExtractor([...])

Transformer for extracting time series features via tsfresh.extract_features.

TSFreshFeatureExtractor([...])

Transformer for extracting time series features via tsfresh.extract_features.

Catch22([features, catch24, outlier_norm, ...])

Canonical Time-series Characteristics (Catch22).

Series-to-series transformers#

Series-to-series transformers transform individual time series into another time series. When applied to collections or hierarchical data, individual series are transformed through broadcasting.

Lagging#

Lag([lags, freq, index_out, ...])

Lagging transformer.

Element-wise transforms#

These transformations apply a function element-wise.

Depending on the transformer, the transformation parameters can be fitted.

BoxCoxTransformer([bounds, method, sp])

Box-Cox power transform.

LogTransformer([offset, scale])

Natural logarithm transformation.

ScaledLogitTransformer([lower_bound, ...])

Scaled logit transform or Log transform.

CosineTransformer([_output_convert])

Cosine transformation.

ExponentTransformer([power, offset])

Apply element-wise exponentiation transformation to a time series.

SqrtTransformer([offset])

Apply element-sise square root transformation to a time series.

Detrending#

Detrender([forecaster, model])

Remove a trend from a series.

Deseasonalizer([sp, model])

Remove seasonal components from a time series.

ConditionalDeseasonalizer([...])

Remove seasonal components from time series, conditional on seasonality test.

STLTransformer([sp, seasonal, trend, ...])

Remove seasonal components from a time-series using STL.

ClearSky([quantile_prob, bw_diurnal, ...])

Clear sky transformer for solar data.

Filtering and denoising#

BKFilter([low, high, K])

Filter a times series using the Baxter-King filter.

KalmanFilterTransformer(state_dim[, ...])

Kalman Filter Transformer.

ThetaLinesTransformer([theta])

Decompose the original data into two or more Theta-lines.

Differencing and slope#

Differencer([lags, na_handling, memory])

Apply iterative differences to a timeseries.

SlopeTransformer([n_intervals])

Piecewise slope transformation.

Binning and segmentation#

TimeBinAggregate(bins[, aggfunc, return_index])

Bins time series and aggregates by bin.

TSInterpolator(length)

Time series interpolator/re-sampler.

IntervalSegmenter([intervals])

Interval segmentation transformer.

RandomIntervalSegmenter([n_intervals, ...])

Random interval segmenter transformer.

Missing value imputation#

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

Missing value imputation.

Seasonality and Date-Time Features#

DateTimeFeatures([ts_freq, feature_scope, ...])

DateTime feature extraction for use in e.g. tree based models.

TimeSince([start, to_numeric, freq, ...])

Get Element-wise time elapsed between the timeindex and a reference start time.

FourierFeatures(sp_list, fourier_terms_list)

Fourier Features for time series seasonality.

Auto-correlation series#

AutoCorrelationTransformer([adjusted, ...])

Auto-correlation transformer.

PartialAutoCorrelationTransformer([n_lags, ...])

Partial auto-correlation transformer.

Window-based series transforms#

These transformers create a series based on a sequence of sliding windows.

HOG1DTransformer([n_intervals, n_bins, ...])

HOG1D transform.

Multivariate-to-univariate#

These transformers convert multivariate series to univariate.

ColumnConcatenator([_output_convert])

Concatenate multivariate series to a long univariate series.

Augmentation#

InvertAugmenter()

Augmenter inverting the time series by multiplying it by -1.

RandomSamplesAugmenter([n, ...])

Draw random samples from time series.

ReverseAugmenter()

Augmenter reversing the time series.

WhiteNoiseAugmenter([scale, random_state])

Augmenter adding Gaussian (i.e. white) noise to the time series.

FeatureSelection#

These transformers select features in X based on y.

FeatureSelection([method, n_columns, ...])

Select exogenous features.

ElbowClassSum([distance, prototype_type, ...])

Elbow Class Sum (ECS) transformer to select a subset of channels/variables.

ElbowClassPairwise([distance, ...])

Elbow Class Pairwise (ECP) transformer to select a subset of channels.

Subsetting time points and variables#

These transformers subset X by time points (pandas index or index level) or variables (pandas columns).

ColumnSelect([columns, integer_treatment, ...])

Column selection transformer.

IndexSubset([index_treatment])

Index subsetting transformer.

Panel transformers#

Panel transformers transform a panel of time series into a panel of time series.

A panel transformer is fitted on an entire panel, and not per series.

Equal length transforms#

These transformations ensure all series in a panel have equal length

PaddingTransformer([pad_length, fill_value])

Pad unequal length time series to equal, fixed length.

TruncationTransformer([truncated_length])

Truncate unequal length time series to a lower bounds.

Dimension reduction#

PCATransformer([n_components, copy, whiten, ...])

Principal Components Analysis applied as transformer.

Series-to-Panel transformers#

These transformers create a panel from a single series.

Bootstrap transformations#

STLBootstrapTransformer([n_series, sp, ...])

Creates a population of similar time series.

MovingBlockBootstrapTransformer([n_series, ...])

Moving Block Bootstrapping method for synthetic time series generation.

Outlier detection, changepoint detection#

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

Use HampelFilter to detect outliers based on a sliding window.

ClaSPTransformer([window_length, ...])

ClaSP (Classification Score Profile) Transformer.

Hierarchical transformers#

These transformers are specifically for hierarchical data and panel data.

The transformation depends on the specified hierarchy in a non-trivial way.

Aggregator([flatten_single_levels])

Prepare hierarchical data, including aggregate levels, from bottom level.

Reconciler([method])

Hierarchical reconcilation transformer.