Contents

f1Score(for:)

Computes the F1 score from predicted and ground truth values.

Declaration

func f1Score(for label: Label) -> Float

Parameters

  • label:

    The label to use as true positive.

Return Value

The F1 score for the given label.

Discussion

The balanced F-score, or F1 score, is computed as the harmonic mean of the precision and recall. If the provided label does not have a confidence threshold, the F1 score is NaN.

See Also

Computing and scoring