state_arl
ARL (average run length) analyzer for no-reset benchmarks.
- class pysatl_cpd.benchmark.online.noreset.tooling.analyzers.state_arl.NoResetArlAnalyzer(entries_picker=None)[source]
Bases:
NoResetAnalyzerBaseAnalyzer that computes average run length at a range of thresholds.
- Parameters:
entries_picker (BenchmarkEntriesPicker | None)
- analyze(benchmark_entry, state, thresholds, arl_length)[source]
Compute ARL for each threshold value.
Retrieves no-change runs matching the detector, state, and length, then evaluates the ARL metric at each threshold.
- Parameters:
benchmark_entry (
OnlineNoResetBenchmarkEntry) – Entry describing detector configuration used for picking and validation.state (
StateDescriptor) – State descriptor for the no-change runs.thresholds (
Sequence[float]) – Threshold values to evaluate.arl_length (
int) – Expected length of each no-change run. Must be positive.
- Returns:
Table with columns
thresholdandarl.- Return type:
DataFrame- Raises:
ValueError – If
arl_lengthis not positive.
- analyze_runs(runs, thresholds)[source]
Compute ARL for already selected and validated no-change runs.
- Return type:
DataFrame- Parameters:
runs (Sequence[SingleRun[OnlineDetectionTrace[Any], LabeledData[Any, TimeseriesAnnotation]]])
- static validate_arl_runs(runs, expected_detector, state, arl_length)[source]
Verify that every run matches the expected detector, state, and length.
- Return type:
- Parameters:
runs (Sequence[SingleRun[OnlineDetectionTrace[Any], LabeledData[Any, TimeseriesAnnotation]]])
expected_detector (ChangePointDetectorDescription)
state (StateDescriptor)
arl_length (int)