Detector
BinarySegmentation
Binary segmentation change point detector.
Quickstart
python
from sktime.detection.bs import BinarySegmentation
estimator = BinarySegmentation(threshold, min_cp_distance=0, max_iter=10000)Parameters(3)
- thresholdfloat
- Threshold for the CUMSUM statistic. Change points that do not increase the CUMSUM statistic above this threshold are ignored.
- min_cp_distanceint
- Minimum distance between change points.
- max_iterint
- Maximum number of interactions before the found change points are returned.
Examples
>>> import pandas as pd
>>> from sktime.detection.bs import BinarySegmentation
>>> model = BinarySegmentation (threshold = 1)
>>> X = pd. Series ([1, 1, 1, 1, 5, 5, 5, 5 ])
>>> model. fit_predict (X) ilocs 0 3
>>> X = pd. Series ([1.1, 1.3, - 1.4, - 1.4, 5.5, 5.6 ])
>>> model. fit_predict (X) ilocs 0 1 1 3References
- [1 ] Fryzlewicz, Piotr. “WILD BINARY SEGMENTATION FOR MULTIPLE CHANGE-POINT DETECTION.” The Annals of Statistics, vol. 42, no. 6, 2014, pp. 2243-81. JSTOR, http://www.jstor.org/stable/43556493. Accessed 4 July 2024.