unweighted_average_fscore()

audmetric.unweighted_average_fscore(truth, prediction, labels=None, *, zero_division=0)[source]

Unweighted average F-score.

UAF=1Kk=1Ktrue positivektrue positivek+12(false positivek+false negativek)\text{UAF} = \frac{1}{K} \sum^K_{k=1} \frac{\text{true positive}_k} {\text{true positive}_k + \frac{1}{2} (\text{false positive}_k + \text{false negative}_k)}
Parameters
  • truth (Sequence[Any]) – ground truth values/classes

  • prediction (Sequence[Any]) – predicted values/classes

  • labels (Optional[Sequence[Any]]) – included labels in preferred ordering. If no labels are supplied, they will be inferred from {prediction,truth}\{\text{prediction}, \text{truth}\} and ordered alphabetically.

  • zero_division (float) – set the value to return when there is a zero division

Return type

float

Returns

unweighted average precision

Examples

>>> unweighted_average_fscore([0, 0], [0, 1])
0.3333333333333333