ChangeFinder reduces change-point detection to outlier detection using a pair of
sequentially discounting autoregressive (SDAR) models. The algorithm operates in
two stages:
Stage 1: An SDAR model is fitted online on the raw signal. Each
observation receives an outlier score (logarithmic or quadratic loss), which
is smoothed by a causal moving average of width T.
Stage 2: A second SDAR model is fitted on the smoothed scores from
Stage 1. A second moving average produces the final change-point score
curve. Peaks in this curve are returned as change points.
The SDAR model maintains an AR(k) model with exponential discounting:
older observations are progressively down-weighted at rate r, allowing the
model to track non-stationary dynamics. AR parameters are updated at each step
by re-solving a discounted Toeplitz system.
This online, single-pass design yields \(O(n \cdot k^2)\) time complexity,
making ChangeFinder efficient for long time series.
Type: change point detection
Supervision: unsupervised or semi-supervised (n_cps)
Scope: univariate and multivariate
Complexity:\(O(n \cdot k^2)\) where k is the AR order
Reference: Takeuchi, J. and Yamanishi, K. (2006), A unifying framework for
detecting outliers and change points from time series, IEEE TKDE, vol. 18,
no. 4, pp. 482–492.
Learns an AR(k) model incrementally with exponential discounting so that
older observations are gradually forgotten. For each new observation the
model produces a predicted mean and variance which can be used to compute
an outlier score.
Takeuchi & Yamanishi, “A Unifying Framework for Detecting Outliers and
Change Points from Time Series”, IEEE TKDE, 2006.
The algorithm operates in two stages:
An SDAR model learns the time series online. Each observation receives
an outlier score (log-loss or quadratic loss). A moving average of
these scores produces a smoothed score series.
A second SDAR model learns the smoothed score series. A second moving
average yields the final change-point score at each time step.
Change points are then selected by peak-picking on the final score curve.
Two-stage online method that reduces change-point detection to outlier
detection. An AR model with exponential discounting (SDAR) computes
outlier scores; a moving average smooths them; a second SDAR + moving
average produces a change-point score curve. Peaks in the curve are
returned as change points.
n_cps (int | None) – Number of change points to return. If None, all peaks above
threshold are returned.
threshold (float | None) – Minimum score for a peak to be accepted as a change point. When
None, a data-driven threshold of mean+2*std of the score
curve is used.
min_distance (int) – Minimum number of samples between successive change points.
multivariate_strategy (str) – Strategy for multivariate inputs: "l2" reduces to univariate
via L2 norm; "ensembling" runs independently per channel and
aggregates.
tolerance (int | float) – Tolerance for aggregating change points across channels (ensembling
strategy only).
Configure whether metadata should be requested to be passed to the fit method.
Note that this method is only relevant when this estimator is used as a
sub-estimator within a meta-estimator and metadata routing is enabled
with enable_metadata_routing=True (see sklearn.set_config()).
Please check the User Guide on how the routing
mechanism works.
The options for each parameter are:
True: metadata is requested, and passed to fit if provided. The request is ignored if metadata is not provided.
False: metadata is not requested and the meta-estimator will not pass it to fit.
None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.
str: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (sklearn.utils.metadata_routing.UNCHANGED) retains the
existing request. This allows you to change the request for some
parameters and not others.
Added in version 1.3.
Parameters:
axis (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for axis parameter in fit.
Configure whether metadata should be requested to be passed to the predict method.
Note that this method is only relevant when this estimator is used as a
sub-estimator within a meta-estimator and metadata routing is enabled
with enable_metadata_routing=True (see sklearn.set_config()).
Please check the User Guide on how the routing
mechanism works.
The options for each parameter are:
True: metadata is requested, and passed to predict if provided. The request is ignored if metadata is not provided.
False: metadata is not requested and the meta-estimator will not pass it to predict.
None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.
str: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (sklearn.utils.metadata_routing.UNCHANGED) retains the
existing request. This allows you to change the request for some
parameters and not others.
Added in version 1.3.
Parameters:
axis (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for axis parameter in predict.
Two-stage online method that reduces change-point detection to outlier
detection. An AR model with exponential discounting (SDAR) computes
outlier scores; a moving average smooths them; a second SDAR + moving
average produces a change-point score curve. Peaks in the curve are
returned as change points.
n_cps (int | None) – Number of change points to return. If None, all peaks above
threshold are returned.
threshold (float | None) – Minimum score for a peak to be accepted as a change point. When
None, a data-driven threshold of mean+2*std of the score
curve is used.
min_distance (int) – Minimum number of samples between successive change points.
multivariate_strategy (str) – Strategy for multivariate inputs: "l2" reduces to univariate
via L2 norm; "ensembling" runs independently per channel and
aggregates.
tolerance (int | float) – Tolerance for aggregating change points across channels (ensembling
strategy only).
Configure whether metadata should be requested to be passed to the fit method.
Note that this method is only relevant when this estimator is used as a
sub-estimator within a meta-estimator and metadata routing is enabled
with enable_metadata_routing=True (see sklearn.set_config()).
Please check the User Guide on how the routing
mechanism works.
The options for each parameter are:
True: metadata is requested, and passed to fit if provided. The request is ignored if metadata is not provided.
False: metadata is not requested and the meta-estimator will not pass it to fit.
None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.
str: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (sklearn.utils.metadata_routing.UNCHANGED) retains the
existing request. This allows you to change the request for some
parameters and not others.
Added in version 1.3.
Parameters:
axis (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for axis parameter in fit.
Configure whether metadata should be requested to be passed to the predict method.
Note that this method is only relevant when this estimator is used as a
sub-estimator within a meta-estimator and metadata routing is enabled
with enable_metadata_routing=True (see sklearn.set_config()).
Please check the User Guide on how the routing
mechanism works.
The options for each parameter are:
True: metadata is requested, and passed to predict if provided. The request is ignored if metadata is not provided.
False: metadata is not requested and the meta-estimator will not pass it to predict.
None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.
str: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (sklearn.utils.metadata_routing.UNCHANGED) retains the
existing request. This allows you to change the request for some
parameters and not others.
Added in version 1.3.
Parameters:
axis (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for axis parameter in predict.