resolver
Threshold resolution logic for no-reset benchmarks.
- class pysatl_cpd.benchmark.online.noreset.thresholds.resolver.ThresholdAutoTuneConfig(*, threshold_count=100, bs_error=1e-06, t_min=0.0, t_max=1.0)[source]
Bases:
objectConfiguration for automatic threshold selection.
- class pysatl_cpd.benchmark.online.noreset.thresholds.resolver.ThresholdAutoTuneResult(*, min_threshold, max_threshold, thresholds, precision, recall)[source]
Bases:
objectResult of automatic threshold tuning.
- Parameters:
- pysatl_cpd.benchmark.online.noreset.thresholds.resolver.auto_pick_thresholds(runs, make_recall, make_precision, *, config)[source]
Automatically select meaningful threshold bounds.
- Return type:
- Parameters:
runs (Sequence[SingleRun[OnlineDetectionTrace, ProviderT]])
make_recall (Callable[[Sequence[SingleRun[OnlineDetectionTrace, ProviderT]]], Callable[[float], float]])
make_precision (Callable[[Sequence[SingleRun[OnlineDetectionTrace, ProviderT]]], Callable[[float], float]])
config (ThresholdAutoTuneConfig)
- class pysatl_cpd.benchmark.online.noreset.thresholds.resolver.NoResetThresholdResolver[source]
Bases:
objectResolves threshold grids for classification and ARL evaluation.
- resolve_classification_thresholds(entry, runs, report)[source]
Resolve classification thresholds from an entry and its runs.
Uses the entry’s explicit threshold range when available, otherwise auto-tunes using the report’s precision and recall metrics.
- Parameters:
entry (
OnlineNoResetBenchmarkEntry) – Benchmark entry with a threshold range specification.runs (
Sequence[SingleRun[OnlineDetectionTrace[Any],Any]]) – Picked runs used for auto-tuning when applicable.report (
NoResetClassificationReport[Any,Any]) – Classification report providing precision and recall metrics.
- Returns:
Sorted list of threshold values.
- Return type:
- resolve_arl_thresholds(entry, runs, thresholds)[source]
Resolve ARL thresholds from an entry and its no-change runs.
Uses the provided thresholds when given, otherwise infers a range from the minimum and maximum detection function values across all runs.
- Parameters:
entry (
OnlineNoResetBenchmarkEntry) – Benchmark entry with a threshold range specification.runs (
Sequence[SingleRun[OnlineDetectionTrace[Any],Any]]) – No-change runs used to infer the threshold range.thresholds (
Sequence[float] |None) – Optional explicit threshold list to use directly.
- Returns:
Sorted list of threshold values.
- Return type:
- Raises:
ValueError – If no runs are provided or any run has an empty trace.
- static infer_t_max_from_trace_values(runs)[source]
Infer an upper bound for auto-tuning from trace detection values.
Computes 101 % of the maximum detection function value across all runs. Returns a small positive epsilon if the result is non-positive.
- Parameters:
runs (
Sequence[SingleRun[OnlineDetectionTrace[Any],Any]]) – Runs whose detection functions are scanned for the maximum.- Returns:
Upper threshold bound for auto-tuning.
- Return type:
- Raises:
ValueError – If no runs are provided or any run has an empty trace.
- __init__()
- Return type:
None