tsseg.algorithms.vsax package
VSAX — Variable-length SAX state detection.
Description
VSAX converts each channel to Symbolic Aggregate approXimation (SAX) symbols, then finds the variable-length segmentation that minimises PAA reconstruction error plus an additive penalty per segment. The pipeline:
Z-normalisation — optionally standardise each channel.
PAA — reduce each candidate segment to
paa_segmentsframes.SAX — discretise PAA values into
alphabet_sizesymbols using Gaussian breakpoints (or adaptive empirical quantiles).DP segmentation — dynamic programming over
num_lengthscandidate segment lengths minimises reconstruction error +penaltyper segment.Symbol merging — per-channel SAX symbol tuples are clustered via agglomerative clustering on Hamming distance (threshold
symbol_merge_threshold).
Parameters
Name |
Type |
Default |
Description |
|---|---|---|---|
|
int |
|
Number of SAX symbols per channel. |
|
int |
|
Number of PAA frames per segment. |
|
int |
|
Minimum admissible segment length. |
|
int |
|
Maximum admissible segment length. |
|
int |
|
Number of candidate lengths (linearly spaced min..max). |
|
float |
|
Cost per new segment. Larger values produce longer segments. |
|
float |
|
Normalised Hamming distance threshold for merging symbols.
|
|
bool |
|
Apply per-channel z-normalisation. |
|
bool |
|
Learn SAX breakpoints from empirical quantiles. |
|
int |
|
Time axis. |
Usage
from tsseg.algorithms import VSAXDetector
detector = VSAXDetector(
alphabet_size=8, penalty=1.0, min_segment_length=30) states =
detector.fit_predict(X)
Implementation: Origin: new code.
Reference: —