mvtsa: segmentation, warping and clustering of multivariate time series ======================================================================= .. image:: _static/banner.png :alt: mvtsa :class: fc-banner **mvtsa** cuts multivariate time series into homogeneous segments, compares series whose time axes do not agree, and groups them. It implements the segmentation and warping methods developed at the University of Pannonia — PCA and dynamic-PCA segmentation, modified Gath–Geva fuzzy segmentation, recursive-PCA on-line segmentation, Fisher-information segmentation, correlation-based dynamic time warping, mixed piecewise-linear measures and episode alignment — next to the strongest methods of the field and several new ones, with tools to evaluate, validate, explain, simplify and operate the resulting models. .. grid:: 1 2 2 3 :gutter: 3 .. grid-item-card:: Segmentation :link: api/segmentation :link-type: doc Costs (L2, Gaussian, linear, AR, kernel, PCA T²/Q, regression) × searches (bottom-up with merge hierarchy, top-down, optimal, PELT, window, SWAB); latent-variable, fuzzy and Fisher segmentation; BOCPD, HMM, ClaSP, FLUSS, state, predictive and consensus segmenters. .. grid-item-card:: Warping :link: api/warping :link-type: doc DTW with constraints, step patterns and lower bounds; derivative, weighted, amerced and shape DTW; LCSS, EDR, ERP, TWED, MSM; soft-DTW, GAK, SBD; correlation-based DTW, MPLA/SPLA/MDPLA and episode alignment. .. grid-item-card:: Clustering :link: api/clustering :link-type: doc k-means with DBA and soft-DTW centres, k-Shape, k-medoids, fuzzy c-medoids, hierarchical, spectral, density-based and consensus clustering; segment and trajectory clustering. .. grid-item-card:: Representations :link: api/representation :link-type: doc PCA, PPCA, recursive and dynamic PCA, similarity factors, SPD geometry; PAA, APCA, PLA, PIP, SAX, ABBA, SFA; episodes; features and path signatures; visibility and recurrence networks; matrix profiles. .. grid-item-card:: Evaluation :link: api/evaluation :link-type: doc F1, covering, Hausdorff; ARI/AMI; retrieval curves; stability and sensitivity; Friedman–Nemenyi and Wilcoxon–Holm tests; benchmarks and grid search. .. grid-item-card:: Model operations :link: api/mlops :link-type: doc Configurations as code, analysis pipelines, model files with checksums, a registry with stages, experiment tracking, data contracts, drift monitoring and model cards. .. grid-item-card:: Gallery :link: auto_examples/index :link-type: doc Forty-eight runnable examples on synthetic data, simulated chemical processes and UEA & UCR collections; each ends with a parameter study. .. grid-item-card:: Method lineage :link: methods :link-type: doc Where every method comes from, with the original publications. .. grid-item-card:: The book :link: book :link-type: doc *Segmentation, Warping and Clustering of Multivariate Time Series in Python*: methods, algorithms and every example of the gallery. Quick start ----------- .. code-block:: python import mvtsa as mv X, cps, _ = mv.datasets.make_correlation_switching(n_segments=4, length=150) seg = mv.segment(X, "pca", n_segments=4, n_components=1) # PCA Q-statistic, bottom-up mv.viz.plot_segmentation(X, seg, truth=cps) C, y = mv.datasets.make_signatures(n_writers=6, n_per_writer=8) D = mv.warping.CBDTW(n_segments=10, n_components=2).fit(C).pairwise() # correlation-based DTW labels = mv.clustering.KMedoids(6, metric="precomputed").fit(D).labels_ .. toctree:: :maxdepth: 1 :hidden: installation auto_examples/index api/index methods book citing changelog