Segmentation, Warping and Clustering of Multivariate Time Series in PythonThe mvtsa toolbox

Appendix B
The example gallery

Every method of the toolbox has at least one runnable example script. The scripts generate or load their own data, explain the method in their comments, and end with a study of the main parameters. The same scripts produce the gallery of the online documentation, the Jupyter notebooks, and every computed figure and code listing of this book. The tables below list them by folder of examples/, with the first figure of the book that each script produced.

B.1 First steps: series, segmentations, representations, PCA models

Folder examples/01_basics/. The methods are described in chapter 1.

Script

Topic

Figure

plot_01_first_steps.py

First steps: segment, look, evaluate

1.4

   

plot_02_representations.py

Representations: PAA, PLA, SAX, episodes

3.1

   

plot_03_pca_models.py

PCA models: T2, Q and similarity factors

2.4

   

B.2 Cost-based segmentation: costs, searches, number of segments

Folder examples/02_cost_segmentation/. The methods are described in chapter 4.

Script

Topic

Figure

plot_01_costs_and_search.py

Costs and search strategies

4.1

   

plot_02_segmentogram.py

The merge hierarchy: segmentogram and persistence

4.2

   

plot_03_number_of_segments.py

How many segments?

—

   

B.3 Latent-variable segmentation: PCA, dynamic PCA, recursive PCA, fuzzy and Fisher segmentation

Folder examples/03_latent_segmentation/. The methods are described in chapter 5.

Script

Topic

Figure

plot_01_pca_t2_q.py

PCA segmentation with the T2 and Q statistics

5.2

   

plot_02_dynamic_pca.py

Dynamic PCA segmentation

5.3

   

plot_03_recursive_pca.py

On-line segmentation with recursive PCA

5.5

   

plot_04_fuzzy_segmentation.py

Fuzzy segmentation with the modified Gath–Geva algorithm

5.6

   

plot_05_fisher_mma.py

Informative segments for parameter estimation (MMA polymerization)

5.7

   

plot_06_energy_regression.py

Operating ranges of an energy indicator

5.8

   

B.4 Probabilistic, profile-based and state segmentation

Folder examples/04_modern_segmentation/. The methods are described in chapter 6.

Script

Topic

Figure

plot_01_bocpd.py

Bayesian on-line change point detection

6.1

   

plot_02_states.py

Recurring operating states

6.2

   

plot_03_clasp_fluss.py

Shape changes: ClaSP and FLUSS

6.3

   

plot_04_predictive.py

Predictive homogeneity with any scikit-learn model

6.4

   

plot_05_consensus.py

Consensus of segmentations

6.5

   

plot_06_streaming.py

Segmentation of a data stream

—

   

B.5 Elastic similarity: DTW and its relatives

Folder examples/05_warping/. The methods are described in chapter 7.

Script

Topic

Figure

plot_01_dtw_basics.py

Dynamic time warping and global constraints

7.1

   

plot_02_dtw_variants.py

A family of elastic measures on Cylinder–Bell–Funnel

7.2

   

plot_03_soft_dtw.py

Soft-DTW: a differentiable alignment and its uncertainty

7.3

   

plot_04_diagnostics_learning.py

Diagnosing and tuning warping

—

   

B.6 Correlation-based and segment-level warping

Folder examples/06_correlation_warping/. The methods are described in chapter 8.

Script

Topic

Figure

plot_01_cbdtw_signatures.py

Correlation-based dynamic time warping

8.2

   

plot_02_correlation_sequences.py

When the information is in the correlation structure

8.3

   

plot_03_dynamic_cbdtw.py

Process-dynamics-aware warping: DPCA-CBDTW

8.4

   

plot_04_japanese_vowels.py

Real data: Japanese vowels and Riemannian local distances

8.5

   

plot_05_pla_mdpla.py

Piecewise linear warping: MPLA, SPLA and MDPLA

8.6

   

plot_06_mixed_segments.py

A multivariate mixed segment distance

—

   

plot_07_episodes.py

Comparing qualitative trends: episode alignment

8.7

   

B.7 Clustering series, segments and trajectories

Folder examples/07_clustering/. The methods are described in chapter 9.

Script

Topic

Figure

plot_01_partitional.py

Partitional clustering: k-means, k-Shape, k-medoids

9.1

   

plot_02_hierarchical_maps.py

Hierarchical clustering and distance maps

9.3

   

plot_03_basic_motions.py

Clustering multivariate recordings: BasicMotions

9.2

   

plot_04_segment_clustering.py

Clustering segments: recurring patterns across series

9.4

   

plot_05_trajectories.py

Objects that move together: trajectory clustering

—

   

B.8 Evaluation, validation and benchmarking

Folder examples/08_evaluation/. The methods are described in chapter 10.

Script

Topic

Figure

plot_01_metrics.py

Measuring segmentation quality

10.1

   

plot_02_stability.py

Is the segmentation stable?

10.2

   

plot_03_benchmark.py

Benchmarking segmenters with statistical tests

10.3

   

plot_04_tuning.py

Tuning segmenter parameters

—

   

B.9 Visualization and explanation

Folder examples/09_visualization/. The methods are described in chapter 11.

Script

Topic

Figure

plot_01_dashboard.py

A one-page segmentation report

11.1

   

plot_02_visibility_graphs.py

Six-sigma visibility graphs

11.2

   

plot_03_recurrence_images.py

Series as images and networks

3.4

   

plot_04_warping_maps.py

Looking inside alignments and collections

11.3

   

B.10 Model operations

Folder examples/10_mlops/. The methods are described in chapter 12.

Script

Topic

Figure

plot_01_pipeline_registry.py

From analysis to a deployable model

—

   

plot_02_drift_monitoring.py

Monitoring a deployed model for drift

12.2

   

plot_03_tracking_cards.py

Experiment tracking and model cards

—

   

B.11 Case studies

Folder examples/11_applications/. The methods are described in chapter 13.

Script

Topic

Figure

plot_01_polymer_grades.py

Grade transitions of a polymerization reactor

13.1

   

plot_02_ph_process.py

Operating regions of a pH neutralization process

13.3

   

plot_03_regime_explanation.py

Explaining operating regimes

13.4