2
$\begingroup$

I recently stumbled over a generalisation of $F_1$ score to cases where the model predicts probabilities: $$ F_1 = 2 \frac{\sum y_i \hat{p}_i}{\sum y_i^2 + \sum \hat{p}_i^2} $$ where $y_i \in \{ 0, 1 \}$ are the true class memberships and $\hat{p}_i \in [0, 1]$ the predicted class probabilities.

$F_1$ score is usually expressed in terms of either precision and recall or of true and false positives and negatives. However, with just elementary algebra it can be re-expressed as: $$ F_1 = 2 \frac{\sum y_i \hat{y}_i}{\sum y_i + \sum \hat{y}_i} $$ with $\hat{y}_i \in \{ 0, 1 \}$ being the predicted class memberships.

I actually have two questions:

  1. Simply substituting $\hat{y}_i$ for $\hat{p}_i$ seems straightforward, but is it legitimate?

  2. Where do the squares in the first formula come from? Is it just because, for binary vectors, $\sum \hat{y}_i = \sum \hat{y}_i^2$, or is there a deeper theoretical justification?

I observed that, when using squares in the denominator, the generalised $F_1$ score reaches maximum when $\hat{p}$ is not too far from the true $p$ (in a way, approximating a proper scoring rule):

Generalised F_1 with squares in the denominator

while for non-squared values the maximum is reached when $\hat{p}$ is either zero or one:

Generalised F_1 score

(similar to Brier score vs. absolute loss). Using such scoring has no advantage over the original, binary $F_1$ score. So, are squares in the denominator just a hack to make generalised $F_1$ more useful in practice?

$\endgroup$
7
  • 1
    $\begingroup$ Do you have a reference for this version of the F1 score? $\endgroup$
    – dipetkov
    Commented Oct 28, 2022 at 9:04
  • $\begingroup$ @dipetkov It came up in a paper I recently reviewed, something about image segmentation using deep neural networks. I cannot share it, but, even if I could, it wouldn't help, as it provides no further details. $\endgroup$
    – Igor F.
    Commented Oct 28, 2022 at 9:26
  • 1
    $\begingroup$ This seems relevant to question #1 (and probably should be cited by the paper you are reviewing?): aclanthology.org/2020.eval4nlp-1.9 $\endgroup$
    – dipetkov
    Commented Oct 28, 2022 at 10:10
  • $\begingroup$ If it appeared in a paper you reviewed, I assume you asked the authors to explain their proposed measure, and/or point to where they found it in the literature? Also, if (if!) the point was to approximate a proper scoring rule, why not use a proper scoring rule in the first place? It may well be that the authors of that paper tried exactly that, without knowing of the concept of a proper scoring rule. $\endgroup$ Commented Oct 28, 2022 at 14:16
  • 1
    $\begingroup$ @dipetkov Thans for the link. On my side, I see that a Wikipedia article (en.wikipedia.org/wiki/Sørensen-Dice_coefficient) mentiones a metric $s_v$, which looks a lot like $F_1$ with squares in the denominator. Unfortunately, it gives no reference. $\endgroup$
    – Igor F.
    Commented Oct 28, 2022 at 14:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.