playground_metrics.metrics_helper
Usage
This module implements helpers used to compute metrics derived from the
MeanAveragePrecisionMetric.
API doc
- class playground_metrics.metrics_helper.mean_fbeta.MeanFBetaAtThresholds(beta, thresholds, **kwargs)[source]
Bases:
objectClass to compute mean F-beta score (averaged and per class) at list of thresholds for detection task.
Notes
Special cases are resolved as following:
if no predictions neither ground truth, then f2 = 1 for all classes
if no predictions but there is a ground truth, f2 = 0 for all classes
if there are predictions, we compute f2 from precision and recall using
MeanAveragePrecisionMetric
- Parameters:
beta (int/float) – F-beta scoring parameter
thresholds (list/tuple of float) – List/tuple of similarity thresholds for which we consider a valid match between detection and ground truth. For example, [0.5, 0.7, 0.9].
**kwargs – kwargs to configure internal
MeanAveragePrecisionMetric
- Raises:
ValueError – If
thresholdsis not a list/tuple or ifbetais not a positive float
- score
Mean F-beta score computed by
compute()from accumulated values- Type:
float
- compute()[source]
Compute the F-beta score averaged over all classes and thresholds according to the accumulated values.
- Returns:
mean F-beta at thresholds
- Return type:
float