state_arl
ARL-by-state scenario for no-reset benchmarks.
- class pysatl_cpd.benchmark.online.noreset.scenarios.state_arl.NoResetArlByStateScenario(entries, collect_states=False, state=None, arl_length=0)[source]
Bases:
NoResetBenchmarkScenario[DataT,DataFrame]Scenario that evaluates ARL for a specific state across thresholds.
- Parameters:
entries (
Sequence[OnlineNoResetBenchmarkEntry]) – Detector entries to benchmark.collect_states (
bool) – Whether to retain algorithm states during detection (default False).state (
StateDescriptor|None) – Target state for no-change providers.arl_length (
int) – Expected length of each no-change run. Must be positive.
- Raises:
ValueError – If
stateis None orarl_lengthis not positive.
- __init__(entries, collect_states=False, state=None, arl_length=0)[source]
- Parameters:
entries (Sequence[OnlineNoResetBenchmarkEntry])
collect_states (bool)
state (StateDescriptor | None)
arl_length (int)
- Return type:
None
- prepare_benchmark_jobs(dataset)[source]
Build ARL benchmark jobs for each entry.
Filters the dataset to segments matching the target state, creates a no-change provider dataset of the requested length, and builds one job per entry.
- Parameters:
dataset (
Dataset[TypeVar(DataT),TimeseriesAnnotation]) – Input dataset with segment annotations.- Returns:
One job per entry, each using the no-change providers.
- Return type:
Sequence[BenchmarkJob[TypeVar(DataT)]]- Raises:
ValueError – If no segments match the target state.
- set_registry(registry)[source]
Set the registry used by the internal ARL analyzer.
- Return type:
- Parameters:
registry (BenchmarkRegistry[DataT, OnlineDetectionTrace[Any]])
- set_classification_report(classification_report)[source]
No-op; ARL scenario does not require a classification report.
- Return type:
- Parameters:
classification_report (NoResetClassificationReport[Any, Any])
- analyze(registry)[source]
Evaluate ARL for every entry using resolved thresholds.
- Parameters:
registry (
BenchmarkRegistry[TypeVar(DataT),OnlineDetectionTrace[Any]]) – Registry containing cached detection runs.- Returns:
ARL table per detector description, or empty dict if no ARL providers were registered.
- Return type:
dict[ChangePointDetectorDescription,DataFrame]
- property state_checked: StateDescriptor
Validated state descriptor; raises if not set.