mvtsa.segmentation.RecursivePCASegmenter#
- class mvtsa.segmentation.RecursivePCASegmenter(threshold=0.8, n_components=2, forgetting=0.98, variable_forgetting=True, lags=0, warmup=50, patience=5, scale=True, refine=True)[source]#
Bases:
BaseSegmenterOn-line segmentation with recursive (dynamic) PCA.
A recursive PCA model with a variable forgetting factor is updated at every sample (
RecursivePCA). The model of the current segment is frozen afterwarmupsamples; when the Krzanowski similarity between the running model and the segment model stays belowthresholdforpatienceconsecutive samples, a change point is declared at the first of them and a new segment starts (Dobos and Abonyi, 2012). The detector works sample by sample, so it can be run on a stream withpartial_fit().- Parameters:
- threshold
float Similarity limit in [0, 1].
- n_components
int Components compared.
- forgetting
float Nominal forgetting factor of the recursive model.
- variable_forgettingbool
Use the Fortescue-type variable forgetting factor.
- lags
int Dynamic PCA lags.
- warmup
int Samples used to build the model of a new segment.
- patience
int Consecutive low-similarity samples required for a change.
- scalebool
or(mean,std) Standardization;
Trueuses the statistics of the series passed tofit(), a tuple fixes them for streaming use.- refinebool
After a detection, localize the change retrospectively: the split of the samples of the current segment that minimizes the two-segment PCA \(Q\) + \(T^2\) (Gaussian) cost; the detection delay of the recursive model is removed from the reported change point.
- threshold
- Attributes: