mvtsa.segmentation.GGSegmenter#
- class mvtsa.segmentation.GGSegmenter(n_segments=4, n_components=1, m=2.0, max_iter=100, tol=1e-05, merge=True, merge_threshold=0.85, lags=0, scale=True, min_sigma_t=0.005, min_weight=0.02)[source]#
Bases:
BaseSegmenterFuzzy segmentation with time-constrained PPCA clusters.
- Parameters:
- n_segments
int Initial number of clusters (segments).
- n_components
int Latent dimension of the PPCA models.
- m
float Fuzzy exponent (\(m=2\) makes the memberships equal to the EM posterior probabilities of the mixture).
- max_iter, tol
int,float Iteration control.
- mergebool
Apply compatible cluster merging after convergence.
- merge_threshold
float Minimal compatibility of two adjacent clusters for merging: the Krzanowski similarity of their PPCA subspaces times \(\exp(-\tfrac12\Delta^2)\), where \(\Delta\) is the distance of their means in units of the average model standard deviation.
- min_weight
float Clusters whose total membership is below this fraction of the series length are removed before merging.
- lags
int Dynamic extension (lag-extended PPCA models).
- scalebool
Standardize the variables first.
- min_sigma_t
float Lower bound of the time spread of a cluster, as a fraction of the series length.
- n_segments
- Attributes:
Examples
>>> from mvtsa.datasets import make_correlation_switching >>> X, cps, _ = make_correlation_switching(n_segments=3, length=150, random_state=2) >>> seg = GGSegmenter(n_segments=3, n_components=1, merge=False).segment(X) >>> seg.memberships.shape (450, 3)
Examples using mvtsa.segmentation.GGSegmenter#
Fuzzy segmentation with the modified Gath–Geva algorithm