base

Generic no-reset metric wrappers.

class pysatl_cpd.benchmark.online.noreset.metrics.base.NoResetThresholdMetric(*args, **kwargs)[source]

Bases: Protocol, Generic

Protocol for no-reset metrics that evaluate threshold callables over runs.

evaluate(runs)[source]

Return a threshold-indexed evaluator.

Parameters:

runs (Sequence[SingleRun[OnlineDetectionTrace[TypeVar(StateT, bound= OnlineAlgorithmState)], TypeVar(ProviderT, bound= LabeledData[Any, Any])]]) – Sequence of runs to evaluate.

Return type:

Callable[[float], TypeVar(ResultT)]

__init__(*args, **kwargs)
class pysatl_cpd.benchmark.online.noreset.metrics.base.NoResetSingleRunMetric(source, policy)[source]

Bases: Generic

Wrap a classical single-run metric with a no-reset policy.

Parameters:
__init__(source, policy)[source]
Parameters:
Return type:

None

evaluate(run)[source]

Return a callable that evaluates the wrapped metric at a threshold.

Parameters:

run (SingleRun[OnlineDetectionTrace[TypeVar(StateT, bound= OnlineAlgorithmState)], TypeVar(ProviderT, bound= LabeledData[Any, Any])]) – Single run with online detection trace.

Return type:

Callable[[float], TypeVar(ResultT)]

class pysatl_cpd.benchmark.online.noreset.metrics.base.NoResetMultipleRunMetric(source, policy)[source]

Bases: Generic

Wrap a classical multiple-run metric with a no-reset policy.

Parameters:
__init__(source, policy)[source]
Parameters:
Return type:

None

evaluate(runs)[source]

Return a callable that evaluates the wrapped metric at a threshold.

Parameters:

runs (Sequence[SingleRun[OnlineDetectionTrace[TypeVar(StateT, bound= OnlineAlgorithmState)], TypeVar(ProviderT, bound= LabeledData[Any, Any])]]) – Sequence of runs to evaluate.

Return type:

Callable[[float], TypeVar(ResultT)]

class pysatl_cpd.benchmark.online.noreset.metrics.base.NoResetDerivedMetric(source, bases)[source]

Bases: Generic

Wrap a classical derived metric with no-reset-aware source metrics.

Parameters:
Raises:

ValueError – If any source metric required by the derived formula is missing.

__init__(source, bases)[source]
Parameters:
Return type:

None

evaluate(runs)[source]

Return a callable that evaluates the wrapped derived metric at a threshold.

Parameters:

runs (Sequence[SingleRun[OnlineDetectionTrace[TypeVar(StateT, bound= OnlineAlgorithmState)], TypeVar(ProviderT, bound= LabeledData[Any, Any])]]) – Sequence of runs to evaluate.

Return type:

Callable[[float], TypeVar(ResultOutT)]

pysatl_cpd.benchmark.online.noreset.metrics.base.wrap_noreset_single_run_metric(source, policy)[source]

Construct a no-reset single-run metric wrapper.

Parameters:
Return type:

NoResetSingleRunMetric[TypeVar(StateT, bound= OnlineAlgorithmState), TypeVar(ProviderT, bound= LabeledData[Any, Any]), TypeVar(ResultT)]

pysatl_cpd.benchmark.online.noreset.metrics.base.wrap_noreset_multiple_run_metric(source, policy)[source]

Construct a no-reset multiple-run metric wrapper.

Parameters:
Return type:

NoResetMultipleRunMetric[TypeVar(StateT, bound= OnlineAlgorithmState), TypeVar(ProviderT, bound= LabeledData[Any, Any]), TypeVar(ResultT)]

pysatl_cpd.benchmark.online.noreset.metrics.base.wrap_noreset_derived_metric(base, bases)[source]

Construct a no-reset derived metric wrapper.

Parameters:
Return type:

NoResetDerivedMetric[TypeVar(StateT, bound= OnlineAlgorithmState), TypeVar(ProviderT, bound= LabeledData[Any, Any]), TypeVar(ResultInT), TypeVar(ResultOutT)]