streamsim.src.detectors.simple module
Simple Statistical Change Point Detector
This module provides a lightweight streaming change point detector that identifies significant deviations from recent signal behavior using a z-score-based approach.
- Detection Method:
The detector maintains a rolling history of recent samples and computes the mean and standard deviation. A new sample is flagged as a change point if it deviates from the recent mean by more than a configurable number of standard deviations (threshold).
- Important Dependencies:
collections.deque: Efficient circular buffer
streamsim.src.core.interfaces.StreamingChangePointDetector: Base interface
Author: F.Feenstra
- class streamsim.src.detectors.simple.SimpleDetector(threshold: float = 2.0)[source]
Bases:
StreamingChangePointDetectorVery simple change point detector that flags points deviating from recent mean by more than a specified number of standard deviations.
- update(x: float) bool[source]
Process a new sample and determine if it represents a change point.
Adds the sample to the rolling history, then checks if it deviates significantly from the recent mean using a z-score-based approach.
- Parameters:
x (float) – The new sample value to evaluate.
- Returns:
True if the sample is flagged as a change point, False otherwise.
- Return type:
bool