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: BaseSegmenter

Fuzzy segmentation with time-constrained PPCA clusters.

Parameters:
n_segmentsint

Initial number of clusters (segments).

n_componentsint

Latent dimension of the PPCA models.

mfloat

Fuzzy exponent (\(m=2\) makes the memberships equal to the EM posterior probabilities of the mixture).

max_iter, tolint, float

Iteration control.

mergebool

Apply compatible cluster merging after convergence.

merge_thresholdfloat

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_weightfloat

Clusters whose total membership is below this fraction of the series length are removed before merging.

lagsint

Dynamic extension (lag-extended PPCA models).

scalebool

Standardize the variables first.

min_sigma_tfloat

Lower bound of the time spread of a cluster, as a fraction of the series length.

Attributes:
memberships_array (T, c)

Fuzzy memberships, clusters ordered in time.

centers_t_, sigmas_t_arrays (c,)

Time centers and spreads of the segments.

models_list of PPCAModel
n_iter_int

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

Fuzzy segmentation with the modified Gath--Geva algorithm