fmeasure

F-beta score over multiple runs.

class pysatl_cpd.analysis.metrics.multiple_run.classification.fmeasure.FScoreMetric(error_margin, beta=1.0)[source]

Bases: DerivedMetric[TraceT, ProviderT, float, float], Generic

Configure the F-beta metric with an error margin.

Parameters:
  • error_margin (tuple[int, int]) – Allowed (left, right) margin around each true change point for matching detections.

  • beta (float) – Weight of recall relative to precision. beta=1 gives the F1 score, larger values emphasize recall, and smaller values emphasize precision.

Raises:

ValueError – If beta is negative.

__init__(error_margin, beta=1.0)[source]
Parameters:
Return type:

None

property bases: Mapping[str, IMultipleRunMetric[TraceT, ProviderT, float]]

Underlying precision and recall metrics.

Return type:

Mapping[str, IMultipleRunMetric]

compute(values)[source]

Compute the F-beta score from precision and recall.

Parameters:

values (Mapping[str, float]) – Must contain precision and recall keys.

Returns:

The F-beta score. Returns 0.0 when the weighted denominator is zero.

Return type:

float