derived_metric

Base class for multi-run metrics derived from other multi-run metrics.

class pysatl_cpd.analysis.metrics.multiple_run.derived_metric.DerivedMetric[source]

Bases: IMultipleRunMetric, Generic

Evaluate several multi-run metrics and combine their outputs.

Notes

The generic parameters identify the detection trace type, labeled data provider type, input metric result type, and derived metric result type.

abstract property bases: Mapping[str, IMultipleRunMetric]

Underlying metrics used to compute the derived value.

Return type:

Mapping[str, IMultipleRunMetric]

abstractmethod compute(values)[source]

Combine already-aggregated metric values into the final result.

Parameters:

values (Mapping[str, TypeVar(ResultInT)]) – Named aggregated metric values.

Return type:

TypeVar(ResultOutT)

evaluate(runs)[source]

Evaluate all source metrics on each run and compute the derived result.

Parameters:

runs (Sequence[SingleRun[TypeVar(TraceT, bound= DetectionTrace), TypeVar(ProviderT, bound= LabeledData[Any, Any])]]) – Sequence of single runs to evaluate.

Return type:

TypeVar(ResultOutT)