fABBA: symbolic approximation of time series

PyPI version BSD 3-Clause license

fABBA converts numerical time series into sequences of symbols. Each symbol represents a learned segment described by its duration and change in value. The sequence and its codebook can reconstruct a lossy approximation of the original data. Applications include compact representations, exploratory pattern analysis and features for downstream learning.

Start with Installation and first reconstruction for one series, Runnable examples and toy applications for complete runnable programs, and Multiple series with a shared JABBA codebook when several series must share a codebook. The Parameters, units and error interpretation guide explains how accuracy, alphabet size and segment length interact. Inspect, export and restore a codebook explains exactly what to retain for decoding.

What the library does

  1. Approximate a sampled signal with a continuous polygonal chain.

  2. Group the chain’s [length, increment] pieces after feature scaling.

  3. Assign a symbol to each group and retain its mean piece as a codebook entry.

  4. Decode symbols, round segment lengths to the sample grid, and integrate increments from the saved starting value.

Symbol strings are meaningful only with their associated codebooks. Independently fitted models can assign different meanings to the same character. fABBA does not make arbitrary symbolic edit distances equivalent to numerical distances. Compression ratios in samples per symbol are not byte-level storage ratios.

Citation

X. Chen and S. Güttel, fABBA: A Python library for the fast symbolic approximation of time series, Journal of Open Source Software 9(95), 6294 (2024). doi:10.21105/joss.06294. See the repository’s CITATION.bib for additional publications.