Skill Tracer
Skills › Scientific Agent Skills › aeon › transformations.md

transformations.md

249 lines · skills/aeon/references/transformations.md at 5f2bc03

Open on GitHub
1# Transformations
2
3Aeon provides extensive transformation capabilities for preprocessing, feature extraction, and representation learning from time series data.
4

Transformations

Aeon provides extensive transformation capabilities for preprocessing, feature extraction, and representation learning from time series data.

Raw lines 1 to 4
5## Transformation Types
6
7Aeon distinguishes between:
8- **CollectionTransformers**: Transform multiple time series (collections)
9- **SeriesTransformers**: Transform individual time series

Transformation Types

Aeon distinguishes between:

  • CollectionTransformers: Transform multiple time series (collections)
  • SeriesTransformers: Transform individual time series
Raw lines 5 to 10
11## Collection Transformers

Collection Transformers

Raw lines 11 to 12
13### Convolution-Based Feature Extraction
15Fast, scalable feature generation using random kernels:
17- `Rocket` - Random convolutional kernels
18- `MiniRocket` - Simplified ROCKET for speed
19- `MultiRocket` - Enhanced ROCKET variant
20- `HydraTransformer` - Multi-resolution dilated convolutions
21- `ROCKETGPU` - GPU-accelerated variant
23**Use when**: Need fast, scalable features for any ML algorithm, strong baseline performance.

Convolution-Based Feature Extraction

Fast, scalable feature generation using random kernels:

  • Rocket - Random convolutional kernels
  • MiniRocket - Simplified ROCKET for speed
  • MultiRocket - Enhanced ROCKET variant
  • HydraTransformer - Multi-resolution dilated convolutions
  • ROCKETGPU - GPU-accelerated variant

Use when: Need fast, scalable features for any ML algorithm, strong baseline performance.

Raw lines 13 to 24
25### Statistical Feature Extraction
27Domain-agnostic features based on time series characteristics:
29- `Catch22` - 22 canonical time-series characteristics
30- `TSFresh` - Comprehensive automated feature extraction (100+ features)
31- `TSFreshRelevant` - Feature extraction with relevance filtering
32- `SevenNumberSummary` - Descriptive statistics (mean, std, quantiles)
34**Use when**: Need interpretable features, domain-agnostic approach, or feeding traditional ML.

Statistical Feature Extraction

Domain-agnostic features based on time series characteristics:

  • Catch22 - 22 canonical time-series characteristics
  • TSFresh - Comprehensive automated feature extraction (100+ features)
  • TSFreshRelevant - Feature extraction with relevance filtering
  • SevenNumberSummary - Descriptive statistics (mean, std, quantiles)

Use when: Need interpretable features, domain-agnostic approach, or feeding traditional ML.

Raw lines 25 to 35
36### Dictionary-Based Representations
38Symbolic approximations for discrete representations:
40- `SAX` - Symbolic Aggregate approXimation
41- `PAA` - Piecewise Aggregate Approximation
42- `SFA` - Symbolic Fourier Approximation
43- `SFAFast` - Optimized SFA
44- `SFAWhole` - SFA on entire series (no windowing)
45- `BORF` - Bag-of-Receptive-Fields
47**Use when**: Need discrete/symbolic representation, dimensionality reduction, interpretability.

Dictionary-Based Representations

Symbolic approximations for discrete representations:

  • SAX - Symbolic Aggregate approXimation
  • PAA - Piecewise Aggregate Approximation
  • SFA - Symbolic Fourier Approximation
  • SFAFast - Optimized SFA
  • SFAWhole - SFA on entire series (no windowing)
  • BORF - Bag-of-Receptive-Fields

Use when: Need discrete/symbolic representation, dimensionality reduction, interpretability.

Raw lines 36 to 48
49### Shapelet-Based Features
51Discriminative subsequence extraction:
53- `RandomShapeletTransform` - Random discriminative shapelets
54- `RandomDilatedShapeletTransform` - Dilated shapelets for multi-scale
55- `SAST` - Scalable And Accurate Subsequence Transform
56- `RSAST` - Randomized SAST
58**Use when**: Need interpretable discriminative patterns, phase-invariant features.

Shapelet-Based Features

Discriminative subsequence extraction:

  • RandomShapeletTransform - Random discriminative shapelets
  • RandomDilatedShapeletTransform - Dilated shapelets for multi-scale
  • SAST - Scalable And Accurate Subsequence Transform
  • RSAST - Randomized SAST

Use when: Need interpretable discriminative patterns, phase-invariant features.

Raw lines 49 to 59
60### Interval-Based Features
62Statistical summaries from time intervals:
64- `RandomIntervals` - Features from random intervals
65- `SupervisedIntervals` - Supervised interval selection
66- `QUANTTransformer` - Quantile-based interval features
68**Use when**: Predictive patterns localized to specific windows.

Interval-Based Features

Statistical summaries from time intervals:

  • RandomIntervals - Features from random intervals
  • SupervisedIntervals - Supervised interval selection
  • QUANTTransformer - Quantile-based interval features

Use when: Predictive patterns localized to specific windows.

Raw lines 60 to 69
70### Preprocessing Transformations
72Data preparation and normalization:
74- `MinMaxScaler` - Scale to [0, 1] range
75- `Normalizer` - Z-normalization (zero mean, unit variance)
76- `Centerer` - Center to zero mean
77- `SimpleImputer` - Fill missing values
78- `DownsampleTransformer` - Reduce temporal resolution
79- `Tabularizer` - Convert time series to tabular format
81**Use when**: Need standardization, missing value handling, format conversion.

Preprocessing Transformations

Data preparation and normalization:

  • MinMaxScaler - Scale to [0, 1] range
  • Normalizer - Z-normalization (zero mean, unit variance)
  • Centerer - Center to zero mean
  • SimpleImputer - Fill missing values
  • DownsampleTransformer - Reduce temporal resolution
  • Tabularizer - Convert time series to tabular format

Use when: Need standardization, missing value handling, format conversion.

Raw lines 70 to 82
83### Specialized Transformations
85Advanced analysis methods:
87- `MatrixProfileTransformer` (series module) - Nearest-neighbor distance per subsequence; requires stumpy
88- `DWTTransformer` - Discrete Wavelet Transform
89- `AutocorrelationFunctionTransformer` - ACF computation
90- `Dobin` (series module) - Distance-based Outlier BasIs using Neighbors
91- `SignatureTransformer` - Path signature methods; aeon 1.6 uses RoughPy instead of esig
92- `PLASeriesTransformer` (series module) - Piecewise Linear Approximation
94`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.

Specialized Transformations

Advanced analysis methods:

  • MatrixProfileTransformer (series module) - Nearest-neighbor distance per subsequence; requires stumpy
  • DWTTransformer - Discrete Wavelet Transform
  • AutocorrelationFunctionTransformer - ACF computation
  • Dobin (series module) - Distance-based Outlier BasIs using Neighbors
  • SignatureTransformer - Path signature methods; aeon 1.6 uses RoughPy instead of esig
  • PLASeriesTransformer (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.

Raw lines 83 to 95
96### Class Imbalance Handling
98- `ADASYN` - Adaptive Synthetic Sampling
99- `SMOTE` - Synthetic Minority Over-sampling
100- `OHIT` - Over-sampling with Highly Imbalanced Time series
102**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.

Class Imbalance Handling

  • ADASYN - Adaptive Synthetic Sampling
  • SMOTE - Synthetic Minority Over-sampling
  • OHIT - 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.

Raw lines 96 to 103
104### Pipeline Composition
106- `CollectionTransformerPipeline` - Chain multiple transformers

Pipeline Composition

  • CollectionTransformerPipeline - Chain multiple transformers
Raw lines 104 to 107
108## Series Transformers
110Transform individual time series (e.g., for preprocessing in forecasting).

Series Transformers

Transform individual time series (e.g., for preprocessing in forecasting).

Raw lines 108 to 111
112### Statistical Analysis
114- `AutoCorrelationSeriesTransformer` - Autocorrelation
115- `StatsModelsACF` / `StatsModelsPACF` are deprecated in 1.6; prefer `AutoCorrelationSeriesTransformer` for ACF and a supported statsmodels PACF workflow when needed

Statistical Analysis

  • AutoCorrelationSeriesTransformer - Autocorrelation
  • StatsModelsACF / StatsModelsPACF are deprecated in 1.6; prefer AutoCorrelationSeriesTransformer for ACF and a supported statsmodels PACF workflow when needed
Raw lines 112 to 116
117### Smoothing and Filtering
119Import smoothing classes from `aeon.transformations.series.smoothing`; `BKFilter` remains in `aeon.transformations.series`.
121- `ExponentialSmoothing` - Exponentially weighted moving average
122- `MovingAverage` - Simple sliding-window average
123- `SavitzkyGolayFilter` - Polynomial smoothing
124- `GaussianFilter` - Gaussian kernel smoothing
125- `BKFilter` - Baxter-King bandpass filter
126- `DiscreteFourierApproximation` - Fourier-based filtering
128**Use when**: Need noise reduction, trend extraction, or frequency filtering.

Smoothing and Filtering

Import smoothing classes from aeon.transformations.series.smoothing; BKFilter remains in aeon.transformations.series.

  • ExponentialSmoothing - Exponentially weighted moving average
  • MovingAverage - Simple sliding-window average
  • SavitzkyGolayFilter - Polynomial smoothing
  • GaussianFilter - Gaussian kernel smoothing
  • BKFilter - Baxter-King bandpass filter
  • DiscreteFourierApproximation - Fourier-based filtering

Use when: Need noise reduction, trend extraction, or frequency filtering.

Raw lines 117 to 129
130### Dimensionality Reduction
132- `PCASeriesTransformer` - Principal component analysis
133- `PLASeriesTransformer` - Piecewise Linear Approximation

Dimensionality Reduction

  • PCASeriesTransformer - Principal component analysis
  • PLASeriesTransformer - Piecewise Linear Approximation
Raw lines 130 to 134
135### Transformations
137- `BoxCoxTransformer` - Variance stabilization
138- `LogTransformer` - Logarithmic scaling
139- `ClaSPTransformer` - Classification Score Profile

Transformations

  • BoxCoxTransformer - Variance stabilization
  • LogTransformer - Logarithmic scaling
  • ClaSPTransformer - Classification Score Profile
Raw lines 135 to 140
141### Pipeline Composition
143- `SeriesTransformerPipeline` (from `aeon.transformations.series.compose`) - Chain series transformers

Pipeline Composition

  • SeriesTransformerPipeline (from aeon.transformations.series.compose) - Chain series transformers
Raw lines 141 to 144
145## Quick Start: Feature Extraction
147```python
148from aeon.transformations.collection.convolution_based import Rocket
149from aeon.classification.sklearn import RotationForestClassifier
150from aeon.datasets import load_classification
152# Load data
153X_train, y_train = load_classification("GunPoint", split="train")
154X_test, y_test = load_classification("GunPoint", split="test")
156# Extract ROCKET features
157rocket = Rocket()
158X_train_features = rocket.fit_transform(X_train)
159X_test_features = rocket.transform(X_test)
161# Use with any sklearn classifier
162clf = RotationForestClassifier()
163clf.fit(X_train_features, y_train)
164accuracy = clf.score(X_test_features, y_test)
165```

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 166
167## Quick Start: Preprocessing Pipeline
169```python
170from aeon.transformations.collection import (
171 MinMaxScaler,
172 SimpleImputer
174from aeon.transformations.collection.compose import CollectionTransformerPipeline
176# Build preprocessing pipeline
177pipeline = CollectionTransformerPipeline([
178 ('imputer', SimpleImputer(strategy='mean')),
179 ('scaler', MinMaxScaler())
180])
182X_transformed = pipeline.fit_transform(X_train)
183```

Quick 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 184
185## Quick Start: Series Smoothing
187```python
188from aeon.transformations.series.smoothing import MovingAverage
190# Smooth individual time series
191smoother = MovingAverage(window_size=5)
192y_smoothed = smoother.fit_transform(y)
193# Univariate output shape: (1, len(y) - window_size + 1)
194```

Quick 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 195
196## Algorithm Selection

Algorithm Selection

Raw lines 196 to 197
198### For Feature Extraction:
199- **Speed + Performance**: MiniRocket
200- **Interpretability**: Catch22, TSFresh
201- **Dimensionality reduction**: PAA, SAX, PCA
202- **Discriminative patterns**: Shapelet transforms
203- **Comprehensive features**: TSFresh (with longer runtime)

For Feature Extraction:

  • Speed + Performance: MiniRocket
  • Interpretability: Catch22, TSFresh
  • Dimensionality reduction: PAA, SAX, PCA
  • Discriminative patterns: Shapelet transforms
  • Comprehensive features: TSFresh (with longer runtime)
Raw lines 198 to 204
205### For Preprocessing:
206- **Normalization**: Normalizer, MinMaxScaler
207- **Smoothing**: MovingAverage, SavitzkyGolayFilter
208- **Missing values**: SimpleImputer
209- **Frequency analysis**: DWTTransformer, Fourier methods

For Preprocessing:

  • Normalization: Normalizer, MinMaxScaler
  • Smoothing: MovingAverage, SavitzkyGolayFilter
  • Missing values: SimpleImputer
  • Frequency analysis: DWTTransformer, Fourier methods
Raw lines 205 to 210
211### For Symbolic Representation:
212- **Fast approximation**: PAA
213- **Alphabet-based**: SAX
214- **Frequency-based**: SFA, SFAFast

For Symbolic Representation:

  • Fast approximation: PAA
  • Alphabet-based: SAX
  • Frequency-based: SFA, SFAFast
Raw lines 211 to 215
216## Best Practices
2181. **Fit on training data only**: Avoid data leakage
219 ```python
220 transformer.fit(X_train)
221 X_train_tf = transformer.transform(X_train)
222 X_test_tf = transformer.transform(X_test)
223 ```
2252. **Pipeline composition**: Chain transformers for complex workflows
226 ```python
227 pipeline = CollectionTransformerPipeline([
228 ('imputer', SimpleImputer()),
229 ('scaler', Normalizer()),
230 ('features', Rocket())
231 ])
232 ```
2343. **Feature selection**: TSFresh can generate many features; consider selection
235 ```python
236 from sklearn.feature_selection import SelectKBest
237 selector = SelectKBest(k=100)
238 X_selected = selector.fit_transform(X_features, y)
239 ```
2414. **Memory considerations**: Some transformers memory-intensive on large datasets
242 - Use MiniRocket instead of ROCKET for speed
243 - Consider downsampling for very long series
244 - Use ROCKETGPU for GPU acceleration
2465. **Domain knowledge**: Choose transformations matching domain:
247 - Periodic data: Fourier-based methods
248 - Noisy data: Smoothing filters
249 - Spike detection: Wavelet transforms

Best Practices

  1. 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)
  1. Pipeline composition: Chain transformers for complex workflows ``python pipeline = CollectionTransformerPipeline([ ('imputer', SimpleImputer()), ('scaler', Normalizer()), ('features', Rocket()) ])
  1. 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)
  1. Memory considerations: Some transformers memory-intensive on large datasets
  2. Use MiniRocket instead of ROCKET for speed
  3. Consider downsampling for very long series
  4. Use ROCKETGPU for GPU acceleration
  1. Domain knowledge: Choose transformations matching domain:
  2. Periodic data: Fourier-based methods
  3. Noisy data: Smoothing filters
  4. Spike detection: Wavelet transforms
Raw lines 216 to 249