tsseg.algorithms.patss package
PaTSS — Pattern-based Time Series Segmentation.
Description
PaTSS detects states in time series by mining frequent temporal patterns, building a pattern-based embedding matrix, and clustering the resulting features. The pipeline consists of three stages:
Pattern mining — extracts frequent sub-patterns from the series using configurable length, frequency and overlap parameters.
Embedding — constructs a binary or frequency-based embedding matrix where each row is a time step and each column a mined pattern.
Segmentation — applies a segmentation algorithm (default: logistic regression classifier) on the embedding to partition the series into states.
All configuration is passed through a config dictionary.
Parameters
Name |
Type |
Default |
Description |
|---|---|---|---|
|
dict / None |
|
Settings for PaTSS. If |
|
int |
|
Time axis (input assumed |
Usage
from tsseg.algorithms import PatssDetector
detector = PatssDetector() # default config
states = detector.fit_predict(X)
# Custom config
detector = PatssDetector(config={"pattern_length": 20, "n_segments": 5})
states = detector.fit_predict(X)
Implementation: Adapted from the original PaTSS code.
Reference: —
Subpackages
- tsseg.algorithms.patss.algorithms package
- tsseg.algorithms.patss.embedding package
- Submodules
- tsseg.algorithms.patss.embedding.FrequentPatternMiningEmbedder module
- tsseg.algorithms.patss.embedding.PatternBasedEmbedder module
- tsseg.algorithms.patss.embedding.PatternBasedEmbedding module
- tsseg.algorithms.patss.embedding.embedding_matrix module
- tsseg.algorithms.patss.embedding.pattern_filter module
- tsseg.algorithms.patss.embedding.pattern_mining module
- Module contents
- tsseg.algorithms.patss.segmentation package