{
  "id": 340392,
  "title": "Metric Weights",
  "url": "/competitions/rsna-2022-cervical-spine-fracture-detection/discussion/340392",
  "author_name": "FelipeKitamura, MD, PhD",
  "post_date": "2022-07-28T19:21:46.467000",
  "votes": 65,
  "comment_count": 12,
  "views": 0,
  "content": "<p>Thanks for joining this competition. We look forward to learning from your solution.</p>\n<p>To help you build your models, we provide the weights of the metric (weighted log loss) below:</p>\n<p>Category: Weight<br>\nVertebrae negative: 1<br>\nVertebrae positive: 2<br>\nPatient negative: 7<br>\nPatient positive: 14</p>",
  "messages": [
    {
      "id": 1875198,
      "postDate": "2022-07-28T19:21:46.467Z",
      "content": "<p>Thanks for joining this competition. We look forward to learning from your solution.</p>\n<p>To help you build your models, we provide the weights of the metric (weighted log loss) below:</p>\n<p>Category: Weight<br>\nVertebrae negative: 1<br>\nVertebrae positive: 2<br>\nPatient negative: 7<br>\nPatient positive: 14</p>",
      "rawMarkdown": "Thanks for joining this competition. We look forward to learning from your solution.\n\nTo help you build your models, we provide the weights of the metric (weighted log loss) below:\n\nCategory: Weight\nVertebrae negative: 1\nVertebrae positive: 2\nPatient negative: 7\nPatient positive: 14",
      "votes": 65
    },
    {
      "id": 1885329,
      "postDate": "2022-08-05T05:23:33.060Z",
      "content": "<p>Thank you <a href=\"https://www.kaggle.com/barteksadlej123\" target=\"_blank\">@barteksadlej123</a> for showing the code of the metric. </p>\n<p><a href=\"https://www.kaggle.com/harshitsheoran\" target=\"_blank\">@harshitsheoran</a><br>\nYou mean,</p>\n<p>def competiton_loss(y_hat, y):<br>\n    loss = loss_fn(y_hat, y)<br>\n    weights = y * competition_weights['+'] + (1 - y) * competition_weights['-']<br>\n    loss = (loss * weights).sum(axis=1)#.mean()</p>\n<pre><code>return loss / weights.sum()\n</code></pre>\n<p>don't you?</p>",
      "rawMarkdown": "Thank you @barteksadlej123 for showing the code of the metric. \n\n@harshitsheoran\nYou mean,\n\ndef competiton_loss(y_hat, y):\n    loss = loss_fn(y_hat, y)\n    weights = y * competition_weights['+'] + (1 - y) * competition_weights['-']\n    loss = (loss * weights).sum(axis=1)#.mean()\n\n    return loss / weights.sum()\n\ndon't you?",
      "votes": 1,
      "replies": [
        {
          "id": 1885335,
          "postDate": "2022-08-05T05:30:02.527Z",
          "content": "<p>yes, that is correct</p>",
          "rawMarkdown": "yes, that is correct",
          "votes": 2
        },
        {
          "id": 1885406,
          "postDate": "2022-08-05T07:01:57.377Z",
          "content": "<p>Yes, I have corrected it. Sorry for mislead.</p>",
          "rawMarkdown": "Yes, I have corrected it. Sorry for mislead.",
          "votes": 1
        }
      ]
    },
    {
      "id": 1977126,
      "postDate": "2022-10-07T19:49:39.423Z",
      "content": "<p><a href=\"https://www.kaggle.com/felipekitamura\" target=\"_blank\">@felipekitamura</a> , I am a bit confused </p>\n<p>If we look at <a href=\"https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/overview/evaluation\" target=\"_blank\">Evaluation Page</a> we can clearly see, that w_j (weight) depends on only certain class (C_1, …, C_7, patient_overall) and does <strong>NOT</strong> depend on class label (whether label is 0 or 1)</p>\n<p>BUT from your post it is obvious that w_j is same for C_1, …, C_7 classes (but still different for patient_overall class) but depends on class label</p>\n<p>So what is True ? Should we stick to your post logic loss computation ?</p>\n<p>Thanks for reply in advance!</p>",
      "rawMarkdown": "@felipekitamura , I am a bit confused \n\nIf we look at [Evaluation Page](https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/overview/evaluation) we can clearly see, that w_j (weight) depends on only certain class (C_1, ..., C_7, patient_overall) and does **NOT** depend on class label (whether label is 0 or 1)\n\nBUT from your post it is obvious that w_j is same for C_1, ..., C_7 classes (but still different for patient_overall class) but depends on class label\n\nSo what is True ? Should we stick to your post logic loss computation ?\n\nThanks for reply in advance!",
      "replies": [
        {
          "id": 2001770,
          "postDate": "2022-10-24T09:50:53.750Z",
          "content": "<p>Thanks for asking. This post has the most detailed information.</p>",
          "rawMarkdown": "Thanks for asking. This post has the most detailed information.",
          "votes": -1
        }
      ]
    },
    {
      "id": 1875748,
      "postDate": "2022-07-29T09:09:43.580Z",
      "content": "<p><a href=\"https://www.kaggle.com/maggiemd\" target=\"_blank\">@maggiemd</a> Would you please pin this discussion? Thanks. </p>",
      "rawMarkdown": "@maggiemd Would you please pin this discussion? Thanks. ",
      "votes": 2,
      "replies": [
        {
          "id": 1876143,
          "postDate": "2022-07-29T15:46:19.063Z",
          "content": "<p>Good idea, done.</p>",
          "rawMarkdown": "Good idea, done.",
          "votes": 4
        }
      ]
    },
    {
      "id": 2007958,
      "postDate": "2022-10-28T15:46:53.353Z",
      "content": "<p>ohhh tenuun</p>",
      "rawMarkdown": "ohhh tenuun\n"
    },
    {
      "id": 1879772,
      "postDate": "2022-08-01T08:52:50.747Z",
      "content": "<p>This means that weights are different in rows, right?<br>\nThe difinition in \"Overview - Evaluation\" is written as 'w_j' and it looks to be same weights in all rows.</p>",
      "rawMarkdown": "This means that weights are different in rows, right?\nThe difinition in \"Overview - Evaluation\" is written as 'w_j' and it looks to be same weights in all rows.",
      "replies": [
        {
          "id": 1879831,
          "postDate": "2022-08-01T09:39:58.340Z",
          "content": "<p>You are correct, <a href=\"https://www.kaggle.com/iwatatakuya\" target=\"_blank\">@iwatatakuya</a>. For example, if study one has no fracture, the weights would be like:</p>\n<p>Study1_C1: 1 <br>\nStudy1_C2: 1<br>\nStudy1_C3: 1<br>\nStudy1_C4: 1<br>\nStudy1_C5: 1<br>\nStudy1_C6: 1<br>\nStudy1_C7: 1<br>\nStudy1_patient_overall: 7</p>",
          "rawMarkdown": "You are correct, @iwatatakuya. For example, if study one has no fracture, the weights would be like:\n\nStudy1_C1: 1 \nStudy1_C2: 1\nStudy1_C3: 1\nStudy1_C4: 1\nStudy1_C5: 1\nStudy1_C6: 1\nStudy1_C7: 1\nStudy1_patient_overall: 7",
          "votes": 4
        },
        {
          "id": 1936382,
          "postDate": "2022-09-12T17:45:02.590Z",
          "rawMarkdown": "",
          "isDeleted": true
        }
      ]
    },
    {
      "id": 1878739,
      "postDate": "2022-07-31T15:39:41.063Z",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/felipekitamura\" target=\"_blank\">@felipekitamura</a> </p>",
      "rawMarkdown": "Thanks @felipekitamura ",
      "votes": 1
    }
  ],
  "comments": [
    {
      "id": 1885329,
      "author_name": "Nidaime PostDoc",
      "author_url": "",
      "post_date": "2022-08-05T05:23:33.060000",
      "content": "<p>Thank you <a href=\"https://www.kaggle.com/barteksadlej123\" target=\"_blank\">@barteksadlej123</a> for showing the code of the metric. </p>\n<p><a href=\"https://www.kaggle.com/harshitsheoran\" target=\"_blank\">@harshitsheoran</a><br>\nYou mean,</p>\n<p>def competiton_loss(y_hat, y):<br>\n    loss = loss_fn(y_hat, y)<br>\n    weights = y * competition_weights['+'] + (1 - y) * competition_weights['-']<br>\n    loss = (loss * weights).sum(axis=1)#.mean()</p>\n<pre><code>return loss / weights.sum()\n</code></pre>\n<p>don't you?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1885335,
          "author_name": "Harshit Sheoran",
          "author_url": "",
          "post_date": "2022-08-05T05:30:02.527000",
          "content": "<p>yes, that is correct</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 1885406,
          "author_name": "Bartek Sadlej",
          "author_url": "",
          "post_date": "2022-08-05T07:01:57.377000",
          "content": "<p>Yes, I have corrected it. Sorry for mislead.</p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1977126,
      "author_name": "Volodymyr",
      "author_url": "",
      "post_date": "2022-10-07T19:49:39.423000",
      "content": "<p><a href=\"https://www.kaggle.com/felipekitamura\" target=\"_blank\">@felipekitamura</a> , I am a bit confused </p>\n<p>If we look at <a href=\"https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/overview/evaluation\" target=\"_blank\">Evaluation Page</a> we can clearly see, that w_j (weight) depends on only certain class (C_1, …, C_7, patient_overall) and does <strong>NOT</strong> depend on class label (whether label is 0 or 1)</p>\n<p>BUT from your post it is obvious that w_j is same for C_1, …, C_7 classes (but still different for patient_overall class) but depends on class label</p>\n<p>So what is True ? Should we stick to your post logic loss computation ?</p>\n<p>Thanks for reply in advance!</p>",
      "votes": 0,
      "replies": [
        {
          "id": 2001770,
          "author_name": "FelipeKitamura, MD, PhD",
          "author_url": "",
          "post_date": "2022-10-24T09:50:53.750000",
          "content": "<p>Thanks for asking. This post has the most detailed information.</p>",
          "votes": -1,
          "replies": []
        }
      ]
    },
    {
      "id": 1875748,
      "author_name": "Innat",
      "author_url": "",
      "post_date": "2022-07-29T09:09:43.580000",
      "content": "<p><a href=\"https://www.kaggle.com/maggiemd\" target=\"_blank\">@maggiemd</a> Would you please pin this discussion? Thanks. </p>",
      "votes": 2,
      "replies": [
        {
          "id": 1876143,
          "author_name": "Sohier Dane",
          "author_url": "",
          "post_date": "2022-07-29T15:46:19.063000",
          "content": "<p>Good idea, done.</p>",
          "votes": 4,
          "replies": []
        }
      ]
    },
    {
      "id": 2007958,
      "author_name": "DEEPALI SINGH",
      "author_url": "",
      "post_date": "2022-10-28T15:46:53.353000",
      "content": "<p>ohhh tenuun</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1879772,
      "author_name": "ganchan",
      "author_url": "",
      "post_date": "2022-08-01T08:52:50.747000",
      "content": "<p>This means that weights are different in rows, right?<br>\nThe difinition in \"Overview - Evaluation\" is written as 'w_j' and it looks to be same weights in all rows.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 1879831,
          "author_name": "FelipeKitamura, MD, PhD",
          "author_url": "",
          "post_date": "2022-08-01T09:39:58.340000",
          "content": "<p>You are correct, <a href=\"https://www.kaggle.com/iwatatakuya\" target=\"_blank\">@iwatatakuya</a>. For example, if study one has no fracture, the weights would be like:</p>\n<p>Study1_C1: 1 <br>\nStudy1_C2: 1<br>\nStudy1_C3: 1<br>\nStudy1_C4: 1<br>\nStudy1_C5: 1<br>\nStudy1_C6: 1<br>\nStudy1_C7: 1<br>\nStudy1_patient_overall: 7</p>",
          "votes": 4,
          "replies": []
        },
        {
          "id": 1936382,
          "author_name": "",
          "author_url": "",
          "post_date": "2022-09-12T17:45:02.590000",
          "content": "",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1878739,
      "author_name": "R SIVA KUMAR",
      "author_url": "",
      "post_date": "2022-07-31T15:39:41.063000",
      "content": "<p>Thanks <a href=\"https://www.kaggle.com/felipekitamura\" target=\"_blank\">@felipekitamura</a> </p>",
      "votes": 1,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1875198": "Thanks for joining this competition. We look forward to learning from your solution.\n\nTo help you build your models, we provide the weights of the metric (weighted log loss) below:\n\nCategory: Weight\nVertebrae negative: 1\nVertebrae positive: 2\nPatient negative: 7\nPatient positive: 14",
    "1885329": "Thank you @barteksadlej123 for showing the code of the metric. \n\n@harshitsheoran\nYou mean,\n\ndef competiton_loss(y_hat, y):\n    loss = loss_fn(y_hat, y)\n    weights = y * competition_weights['+'] + (1 - y) * competition_weights['-']\n    loss = (loss * weights).sum(axis=1)#.mean()\n\n    return loss / weights.sum()\n\ndon't you?",
    "1977126": "@felipekitamura , I am a bit confused \n\nIf we look at [Evaluation Page](https://www.kaggle.com/competitions/rsna-2022-cervical-spine-fracture-detection/overview/evaluation) we can clearly see, that w_j (weight) depends on only certain class (C_1, ..., C_7, patient_overall) and does **NOT** depend on class label (whether label is 0 or 1)\n\nBUT from your post it is obvious that w_j is same for C_1, ..., C_7 classes (but still different for patient_overall class) but depends on class label\n\nSo what is True ? Should we stick to your post logic loss computation ?\n\nThanks for reply in advance!",
    "1875748": "@maggiemd Would you please pin this discussion? Thanks. ",
    "2007958": "ohhh tenuun\n",
    "1879772": "This means that weights are different in rows, right?\nThe difinition in \"Overview - Evaluation\" is written as 'w_j' and it looks to be same weights in all rows.",
    "1878739": "Thanks @felipekitamura "
  }
}