sciquence.representation.sax¶
-
sciquence.representation.
sax
(sequence, window, alphabet_size=5, adjust=True)[source]¶ Symbolic Aggregate Approximation.
Transform time series into a string.
Parameters: - sequence (numpy.ndarray) – One-dimensional numpy array of arbitrary length
- window (int) – Length of sliding window
- alphabet_size (int) – Number of Gaussian breakpoints
- adjust (bool, default True) – Compute only for equal-size chunks
Returns: sax_representation – A SAX representation
Return type: str
Examples
>>> import numpy as np >>> from sciquence.representation import sax >>> np.random.seed(42) >>> random_time_series = np.random.rand(50) >>> print sax(random_time_series, 10, alphabet_size=5) dcccc
References
[1] Lin, J., Keogh, E., Lonardi, S., & Chiu, B. (2003). A Symbolic Representation of Time Series, with Implications for Streaming Algorithms. In proceedings of the 8th ACM SIGMOD Workshop on Research Issues in Data Mining and Knowledge Discovery.
[2] http://www.cs.ucr.edu/~eamonn/SAX.htm [3] https://jmotif.github.io/sax-vsm_site/morea/algorithm/SAX.html