mvtsa.segmentation.PredictiveSegmenter#
- class mvtsa.segmentation.PredictiveSegmenter(kind='classifier', estimator=None, n_segments=None, threshold=None, initial_size=30, criterion_params=None)[source]#
Bases:
NeighborMergeSegmenterBottom-up segmentation by predictive homogeneity.
- Parameters:
- kind{“classifier”, “regression”}
- estimatorscikit-learn
estimator,optional - n_segments
int,optional - threshold
float,optional Stop merging when the smallest dissimilarity exceeds it.
- initial_size
int - criterion_params
dict,optional Further arguments of
ClassifierHomogeneityorRegressionHomogeneity.
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