classification_table_transition

Transition-filtered classification table scenario for no-reset benchmarks.

class pysatl_cpd.benchmark.online.noreset.scenarios.classification_table_transition.NoResetClassificationTableByTransitionScenario(entries, collect_states=False, transition=None, use_arl=False, arl_length=None)[source]

Bases: NoResetBenchmarkScenario[DataT, DataFrame]

Scenario that computes classification metrics for a specific transition.

Parameters:
  • entries (Sequence[OnlineNoResetBenchmarkEntry]) – Detector entries to benchmark.

  • collect_states (bool) – Whether to retain algorithm states during detection (default False).

  • transition (TransitionDescriptor | None) – Target transition for bisegment filtering.

  • use_arl (bool) – Whether to include an ARL column (default False).

  • arl_length (int | None) – Expected length of each no-change run; required if use_arl is True.

Raises:

ValueError – If transition is None, or use_arl is True without a positive arl_length.

__init__(entries, collect_states=False, transition=None, use_arl=False, arl_length=None)[source]
Parameters:
Return type:

None

set_registry(registry)[source]

Set the registry on both classification and ARL analyzers.

Return type:

None

Parameters:

registry (BenchmarkRegistry[DataT, OnlineDetectionTrace[Any]])

set_classification_report(classification_report)[source]

Set the classification report on the internal analyzer.

Return type:

None

Parameters:

classification_report (NoResetClassificationReport[Any, Any])

prepare_benchmark_jobs(dataset)[source]

Build jobs for bisegment providers and optionally ARL providers.

Filters the dataset to bisegments matching the transition, and optionally adds no-change providers for ARL evaluation.

Parameters:

dataset (Dataset[TypeVar(DataT), TimeseriesAnnotation]) – Input dataset with segment and bisegment annotations.

Returns:

Jobs per entry, each with bisegment (and optionally ARL) providers.

Return type:

Sequence[BenchmarkJob[TypeVar(DataT)]]

analyze(registry)[source]

Evaluate classification metrics per entry, optionally adding ARL.

Picks runs using a transition-based picker, resolves thresholds, computes the classification table, and appends an ARL column if configured.

Parameters:

registry (BenchmarkRegistry[TypeVar(DataT), OnlineDetectionTrace[Any]]) – Registry containing cached detection runs.

Returns:

Classification table (with optional ARL column) per detector description.

Return type:

dict[ChangePointDetectorDescription, DataFrame]

property transition_checked: TransitionDescriptor

Validated transition descriptor; raises if not set.

property arl_length_checked: int

Validated ARL length; raises if not set or not positive.