reset_detector
Online reset change-point detector.
This module implements a detector that resets the online algorithm after each declared change point.
- class pysatl_cpd.core.online.detectors.reset_detector.OnlineResetDetector(algorithm, *, threshold=nan, skip_period=0, max_runlength=None, collect_states=True, data_transformer=None)[source]
Bases:
OnlineDetector,GenericOnline detector that resets its algorithm after every detected change point.
Iterates over a data provider, feeds each observation to the algorithm, compares the resulting statistic against a threshold, and optionally enforces a maximum run-length and a post-detection skip period.
- Parameters:
algorithm (
OnlineAlgorithm[TypeVar(DataT),TypeVar(ConfigurationT, bound=OnlineAlgorithmConfiguration),TypeVar(StateT, bound=OnlineAlgorithmState)]) – Algorithm instance that drives per-step detection.threshold (
float) – Detection threshold. A change point is declared when the algorithm’s detection statistic exceeds this value. Default isnan(no signal-based detections).skip_period (
int) – Number of steps to skip (suppress detections) after each declared change point. Must be non-negative.max_runlength (
int|None) – If notNone, forces a change-point declaration once the run length exceeds this value. Must be positive if specified.collect_states (
bool) – Whether to collect algorithm state snapshots in step results. If False, algorithm_state will be None in all step results.data_transformer (
Optional[IDataTransformer[Any,Any]]) – Optional transformer applied to incoming data before detection.
- Raises:
ValueError – If
skip_periodis negative, or ifmax_runlengthis not None and not positive.
- __init__(algorithm, *, threshold=nan, skip_period=0, max_runlength=None, collect_states=True, data_transformer=None)[source]
- Parameters:
algorithm (OnlineAlgorithm)
threshold (float)
skip_period (int)
max_runlength (int | None)
collect_states (bool)
data_transformer (IDataTransformer[Any, Any] | None)
- Return type:
None
- property description: ChangePointDetectorDescription
Return a static description of this detector and its parameters.
- Returns:
Description containing the detector name, threshold, skip period, max run-length, state-collection flag, and data transformer annotation.
- Return type:
ChangePointDetectorDescription
- clone()[source]
Create an independent copy of this detector.
The clone uses a recreated (fresh) algorithm instance and shares the same threshold, skip period, max run-length, and data transformer settings as the original.
- Returns:
A new detector instance with identical configuration.
- Return type:
Self