{
  "id": 369902,
  "title": "bug in the metric?",
  "url": "/competitions/rsna-breast-cancer-detection/discussion/369902",
  "author_name": "Bo",
  "post_date": "2022-12-01T20:53:05.308000",
  "votes": 15,
  "comment_count": 2,
  "views": 0,
  "content": "<p>I believe there's a bug in Kaggle's implementation of the pF score <a href=\"https://www.kaggle.com/code/sohier/probabilistic-f-score/notebook\" target=\"_blank\">here</a></p>\n<p>According to equation (6) in the <a href=\"https://aclanthology.org/2020.eval4nlp-1.9.pdf\" target=\"_blank\">paper</a>, cFP should only be computed when the GT is False. So this line is unnecessary and should be removed: <code>cfp += 1 - prediction</code></p>\n<p>As a sanity check, pF1 score is a generalization of F1 score, and F1 score is a special case of pF1 score when all the predictions are binary. But this is not the case in current implementation. I've illustrated it <a href=\"https://www.kaggle.com/code/boliu0/probabilistic-f-score-bug/notebook\" target=\"_blank\">here</a></p>\n<p>I already commented under the metric notebook, but not sure if anyone have seen it. </p>\n<p><a href=\"https://www.kaggle.com/sohier\" target=\"_blank\">@sohier</a> <a href=\"https://www.kaggle.com/maggiemd\" target=\"_blank\">@maggiemd</a> Could you take a look? Thanks. </p>",
  "messages": [
    {
      "id": 2052040,
      "postDate": "2022-12-01T20:53:05.310Z",
      "content": "<p>I believe there's a bug in Kaggle's implementation of the pF score <a href=\"https://www.kaggle.com/code/sohier/probabilistic-f-score/notebook\" target=\"_blank\">here</a></p>\n<p>According to equation (6) in the <a href=\"https://aclanthology.org/2020.eval4nlp-1.9.pdf\" target=\"_blank\">paper</a>, cFP should only be computed when the GT is False. So this line is unnecessary and should be removed: <code>cfp += 1 - prediction</code></p>\n<p>As a sanity check, pF1 score is a generalization of F1 score, and F1 score is a special case of pF1 score when all the predictions are binary. But this is not the case in current implementation. I've illustrated it <a href=\"https://www.kaggle.com/code/boliu0/probabilistic-f-score-bug/notebook\" target=\"_blank\">here</a></p>\n<p>I already commented under the metric notebook, but not sure if anyone have seen it. </p>\n<p><a href=\"https://www.kaggle.com/sohier\" target=\"_blank\">@sohier</a> <a href=\"https://www.kaggle.com/maggiemd\" target=\"_blank\">@maggiemd</a> Could you take a look? Thanks. </p>",
      "rawMarkdown": "I believe there's a bug in Kaggle's implementation of the pF score [here](https://www.kaggle.com/code/sohier/probabilistic-f-score/notebook)\n\nAccording to equation (6) in the [paper](https://aclanthology.org/2020.eval4nlp-1.9.pdf), cFP should only be computed when the GT is False. So this line is unnecessary and should be removed: `cfp += 1 - prediction`\n\nAs a sanity check, pF1 score is a generalization of F1 score, and F1 score is a special case of pF1 score when all the predictions are binary. But this is not the case in current implementation. I've illustrated it [here](https://www.kaggle.com/code/boliu0/probabilistic-f-score-bug/notebook)\n\n\nI already commented under the metric notebook, but not sure if anyone have seen it. \n\n@sohier @maggiemd Could you take a look? Thanks. ",
      "votes": 15
    },
    {
      "id": 2052299,
      "postDate": "2022-12-02T04:33:23.173Z",
      "content": "<p>The issue should be resolved now: <a href=\"https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/369921\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/369921</a></p>",
      "rawMarkdown": "The issue should be resolved now: https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/369921",
      "replies": [
        {
          "id": 2052301,
          "postDate": "2022-12-02T04:35:42.867Z",
          "content": "<p>Thanks for fixing it so quickly</p>",
          "rawMarkdown": "Thanks for fixing it so quickly"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2052299,
      "author_name": "Sohier Dane",
      "author_url": "",
      "post_date": "2022-12-02T04:33:23.173000",
      "content": "<p>The issue should be resolved now: <a href=\"https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/369921\" target=\"_blank\">https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/369921</a></p>",
      "votes": 0,
      "replies": [
        {
          "id": 2052301,
          "author_name": "Bo",
          "author_url": "",
          "post_date": "2022-12-02T04:35:42.867000",
          "content": "<p>Thanks for fixing it so quickly</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2052040": "I believe there's a bug in Kaggle's implementation of the pF score [here](https://www.kaggle.com/code/sohier/probabilistic-f-score/notebook)\n\nAccording to equation (6) in the [paper](https://aclanthology.org/2020.eval4nlp-1.9.pdf), cFP should only be computed when the GT is False. So this line is unnecessary and should be removed: `cfp += 1 - prediction`\n\nAs a sanity check, pF1 score is a generalization of F1 score, and F1 score is a special case of pF1 score when all the predictions are binary. But this is not the case in current implementation. I've illustrated it [here](https://www.kaggle.com/code/boliu0/probabilistic-f-score-bug/notebook)\n\n\nI already commented under the metric notebook, but not sure if anyone have seen it. \n\n@sohier @maggiemd Could you take a look? Thanks. ",
    "2052299": "The issue should be resolved now: https://www.kaggle.com/competitions/rsna-breast-cancer-detection/discussion/369921"
  }
}