transformations.md
249 lines · skills/aeon/references/transformations.md at 5f2bc03
Transformations
Aeon provides extensive transformation capabilities for preprocessing, feature extraction, and representation learning from time series data.
Raw lines 1 to 4Transformation Types
Aeon distinguishes between:
- CollectionTransformers: Transform multiple time series (collections)
- SeriesTransformers: Transform individual time series
Collection Transformers
Raw lines 11 to 12Convolution-Based Feature Extraction
Fast, scalable feature generation using random kernels:
Rocket- Random convolutional kernelsMiniRocket- Simplified ROCKET for speedMultiRocket- Enhanced ROCKET variantHydraTransformer- Multi-resolution dilated convolutionsROCKETGPU- GPU-accelerated variant
Use when: Need fast, scalable features for any ML algorithm, strong baseline performance.
Raw lines 13 to 24Statistical Feature Extraction
Domain-agnostic features based on time series characteristics:
Catch22- 22 canonical time-series characteristicsTSFresh- Comprehensive automated feature extraction (100+ features)TSFreshRelevant- Feature extraction with relevance filteringSevenNumberSummary- Descriptive statistics (mean, std, quantiles)
Use when: Need interpretable features, domain-agnostic approach, or feeding traditional ML.
Raw lines 25 to 35Dictionary-Based Representations
Symbolic approximations for discrete representations:
SAX- Symbolic Aggregate approXimationPAA- Piecewise Aggregate ApproximationSFA- Symbolic Fourier ApproximationSFAFast- Optimized SFASFAWhole- SFA on entire series (no windowing)BORF- Bag-of-Receptive-Fields
Use when: Need discrete/symbolic representation, dimensionality reduction, interpretability.
Raw lines 36 to 48Shapelet-Based Features
Discriminative subsequence extraction:
RandomShapeletTransform- Random discriminative shapeletsRandomDilatedShapeletTransform- Dilated shapelets for multi-scaleSAST- Scalable And Accurate Subsequence TransformRSAST- Randomized SAST
Use when: Need interpretable discriminative patterns, phase-invariant features.
Raw lines 49 to 59Interval-Based Features
Statistical summaries from time intervals:
RandomIntervals- Features from random intervalsSupervisedIntervals- Supervised interval selectionQUANTTransformer- Quantile-based interval features
Use when: Predictive patterns localized to specific windows.
Raw lines 60 to 69Preprocessing Transformations
Data preparation and normalization:
MinMaxScaler- Scale to [0, 1] rangeNormalizer- Z-normalization (zero mean, unit variance)Centerer- Center to zero meanSimpleImputer- Fill missing valuesDownsampleTransformer- Reduce temporal resolutionTabularizer- Convert time series to tabular format
Use when: Need standardization, missing value handling, format conversion.
Raw lines 70 to 82Specialized Transformations
Advanced analysis methods:
MatrixProfileTransformer(series module) - Nearest-neighbor distance per subsequence; requires stumpyDWTTransformer- Discrete Wavelet TransformAutocorrelationFunctionTransformer- ACF computationDobin(series module) - Distance-based Outlier BasIs using NeighborsSignatureTransformer- Path signature methods; aeon 1.6 uses RoughPy instead of esigPLASeriesTransformer(series module) - Piecewise Linear Approximation
Normalizer and MinMaxScaler scale each case/channel along time; they do not learn population-wide feature statistics. Catch22 uses native features by default; use_pycatch22 is deprecated in 1.6.
Class Imbalance Handling
ADASYN- Adaptive Synthetic SamplingSMOTE- Synthetic Minority Over-samplingOHIT- Over-sampling with Highly Imbalanced Time series
Use when: Classification with imbalanced classes. Apply samplers only inside training folds; sampler fit_transform(X, y) returns resampled (X, y), so do not treat it as a feature-only transformer.
Series Transformers
Transform individual time series (e.g., for preprocessing in forecasting).
Raw lines 108 to 111Statistical Analysis
AutoCorrelationSeriesTransformer- AutocorrelationStatsModelsACF/StatsModelsPACFare deprecated in 1.6; preferAutoCorrelationSeriesTransformerfor ACF and a supported statsmodels PACF workflow when needed
Smoothing and Filtering
Import smoothing classes from aeon.transformations.series.smoothing; BKFilter remains in aeon.transformations.series.
ExponentialSmoothing- Exponentially weighted moving averageMovingAverage- Simple sliding-window averageSavitzkyGolayFilter- Polynomial smoothingGaussianFilter- Gaussian kernel smoothingBKFilter- Baxter-King bandpass filterDiscreteFourierApproximation- Fourier-based filtering
Use when: Need noise reduction, trend extraction, or frequency filtering.
Raw lines 117 to 129Dimensionality Reduction
PCASeriesTransformer- Principal component analysisPLASeriesTransformer- Piecewise Linear Approximation
Transformations
BoxCoxTransformer- Variance stabilizationLogTransformer- Logarithmic scalingClaSPTransformer- Classification Score Profile
Pipeline Composition
SeriesTransformerPipeline(fromaeon.transformations.series.compose) - Chain series transformers
Quick Start: Feature Extraction
from aeon.transformations.collection.convolution_based import Rocket
from aeon.classification.sklearn import RotationForestClassifier
from aeon.datasets import load_classification
# Load data
X_train, y_train = load_classification("GunPoint", split="train")
X_test, y_test = load_classification("GunPoint", split="test")
# Extract ROCKET features
rocket = Rocket()
X_train_features = rocket.fit_transform(X_train)
X_test_features = rocket.transform(X_test)
# Use with any sklearn classifier
clf = RotationForestClassifier()
clf.fit(X_train_features, y_train)
accuracy = clf.score(X_test_features, y_test)Raw lines 145 to 166Quick Start: Preprocessing Pipeline
from aeon.transformations.collection import (
MinMaxScaler,
SimpleImputer
)
from aeon.transformations.collection.compose import CollectionTransformerPipeline
# Build preprocessing pipeline
pipeline = CollectionTransformerPipeline([
('imputer', SimpleImputer(strategy='mean')),
('scaler', MinMaxScaler())
])
X_transformed = pipeline.fit_transform(X_train)Raw lines 167 to 184Quick Start: Series Smoothing
from aeon.transformations.series.smoothing import MovingAverage
# Smooth individual time series
smoother = MovingAverage(window_size=5)
y_smoothed = smoother.fit_transform(y)
# Univariate output shape: (1, len(y) - window_size + 1)Raw lines 185 to 195Algorithm Selection
Raw lines 196 to 197For Feature Extraction:
- Speed + Performance: MiniRocket
- Interpretability: Catch22, TSFresh
- Dimensionality reduction: PAA, SAX, PCA
- Discriminative patterns: Shapelet transforms
- Comprehensive features: TSFresh (with longer runtime)
For Preprocessing:
- Normalization: Normalizer, MinMaxScaler
- Smoothing: MovingAverage, SavitzkyGolayFilter
- Missing values: SimpleImputer
- Frequency analysis: DWTTransformer, Fourier methods
For Symbolic Representation:
- Fast approximation: PAA
- Alphabet-based: SAX
- Frequency-based: SFA, SFAFast
Best Practices
- Fit on training data only: Avoid data leakage ``
python transformer.fit(X_train) X_train_tf = transformer.transform(X_train) X_test_tf = transformer.transform(X_test)
- Pipeline composition: Chain transformers for complex workflows ``
python pipeline = CollectionTransformerPipeline([ ('imputer', SimpleImputer()), ('scaler', Normalizer()), ('features', Rocket()) ])
- Feature selection: TSFresh can generate many features; consider selection ``
python from sklearn.feature_selection import SelectKBest selector = SelectKBest(k=100) X_selected = selector.fit_transform(X_features, y)
- Memory considerations: Some transformers memory-intensive on large datasets
- Use MiniRocket instead of ROCKET for speed
- Consider downsampling for very long series
- Use ROCKETGPU for GPU acceleration
- Domain knowledge: Choose transformations matching domain:
- Periodic data: Fourier-based methods
- Noisy data: Smoothing filters
- Spike detection: Wavelet transforms