detection_trace
Module contains detection trace container for changepoint detection results.
This module provides a unified container for storing detection results from both online and offline changepoint detection algorithms.
- class pysatl_cpd.core.detection_trace.DetectionTrace(*, detected_change_points=<factory>, detector_description)[source]
Bases:
objectContainer for changepoint detection algorithm output.
This class stores the detected changepoint positions It serves as a unified result type for both online and offline detection algorithms.
- Variables:
detected_change_points – Indices where changepoints were detected. For online algorithms, these are typically reported as they occur. For offline algorithms, these are the final changepoint positions.
detector_description – Description of the detector that produced the trace.
- Parameters:
detector_description (ChangePointDetectorDescription)
Examples
>>> trace = DetectionTrace(detected_change_points=[2, 4]) >>> trace.detected_changes [2, 4]
- detector_description: ChangePointDetectorDescription
- __post_init__()[source]
Validate detection trace consistency.
Ensures that: - Detected change-point indices are valid (non-negative) - All indices are unique
- Raises:
ValueError – If any detected change index is negative, or if indices are not unique.
- Return type:
- __init__(*, detected_change_points=<factory>, detector_description)
- Parameters:
detector_description (ChangePointDetectorDescription)
- Return type:
None