mvtsa.segmentation.PredictiveSegmenter#

class mvtsa.segmentation.PredictiveSegmenter(kind='classifier', estimator=None, n_segments=None, threshold=None, initial_size=30, criterion_params=None)[source]#

Bases: NeighborMergeSegmenter

Bottom-up segmentation by predictive homogeneity.

Parameters:
kind{“classifier”, “regression”}
estimatorscikit-learn estimator, optional
n_segmentsint, optional
thresholdfloat, optional

Stop merging when the smallest dissimilarity exceeds it.

initial_sizeint
criterion_paramsdict, optional

Further arguments of ClassifierHomogeneity or RegressionHomogeneity.

Examples

>>> from mvtsa.datasets import make_piecewise_stationary
>>> X, cps, _ = make_piecewise_stationary(3, 120, 2, random_state=0)
>>> PredictiveSegmenter(n_segments=3, initial_size=40).segment(X).change_points.tolist()
[120, 240]

Examples using mvtsa.segmentation.PredictiveSegmenter#

Predictive homogeneity with any scikit-learn model

Predictive homogeneity with any scikit-learn model