{
  "id": 159776,
  "title": "Loss based on Label",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/159776",
  "author_name": "Gaurav Yadav",
  "post_date": "2020-06-18T17:05:36.293000",
  "votes": 1,
  "comment_count": 1,
  "views": 0,
  "content": "<p>I saw people using 'Binary Crossentropy', 'sparse_categorical_crossentropy', 'categorical_crossentropy' e.t.c and for labels using direct labels, one hot encoding, Binning the labels from <a href=\"https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87/data\">kernal</a>. \nNow I got confused how to choose loss function, activation function and matrices based on how labels are used.\nAlso how to use 'quadratic weighted kappa' as a loss function to optimize model instead of just tracking qwk score.</p>\n\n<p>Thanks</p>",
  "messages": [
    {
      "id": 892112,
      "postDate": "2020-06-18T17:05:36.293Z",
      "content": "<p>I saw people using 'Binary Crossentropy', 'sparse_categorical_crossentropy', 'categorical_crossentropy' e.t.c and for labels using direct labels, one hot encoding, Binning the labels from <a href=\"https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87/data\">kernal</a>. \nNow I got confused how to choose loss function, activation function and matrices based on how labels are used.\nAlso how to use 'quadratic weighted kappa' as a loss function to optimize model instead of just tracking qwk score.</p>\n\n<p>Thanks</p>",
      "rawMarkdown": "I saw people using 'Binary Crossentropy', 'sparse_categorical_crossentropy', 'categorical_crossentropy' e.t.c and for labels using direct labels, one hot encoding, Binning the labels from [kernal](https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87/data). \nNow I got confused how to choose loss function, activation function and matrices based on how labels are used.\nAlso how to use 'quadratic weighted kappa' as a loss function to optimize model instead of just tracking qwk score.\n\nThanks",
      "votes": 1
    },
    {
      "id": 892116,
      "postDate": "2020-06-18T17:08:54.440Z",
      "content": "<p>Cross entropy =&gt; Label must be class integer (or one hot in some cases). Read the doc of the loss you are using. If you use pytorch cross entropy loss then label is class integer.\nBinary Cross entropy =&gt; This suggest the binning approach in one of the top kernel. Label must be [1, 1, 0, 0, 0] for class 2 for example.\nMSE =&gt; Label must be class integer (cast as float).</p>",
      "rawMarkdown": "Cross entropy =&gt; Label must be class integer (or one hot in some cases). Read the doc of the loss you are using. If you use pytorch cross entropy loss then label is class integer.\nBinary Cross entropy =&gt; This suggest the binning approach in one of the top kernel. Label must be [1, 1, 0, 0, 0] for class 2 for example.\nMSE =&gt; Label must be class integer (cast as float)."
    }
  ],
  "comments": [
    {
      "id": 892116,
      "author_name": "Arnaud Roussel",
      "author_url": "",
      "post_date": "2020-06-18T17:08:54.440000",
      "content": "<p>Cross entropy =&gt; Label must be class integer (or one hot in some cases). Read the doc of the loss you are using. If you use pytorch cross entropy loss then label is class integer.\nBinary Cross entropy =&gt; This suggest the binning approach in one of the top kernel. Label must be [1, 1, 0, 0, 0] for class 2 for example.\nMSE =&gt; Label must be class integer (cast as float).</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "892112": "I saw people using 'Binary Crossentropy', 'sparse_categorical_crossentropy', 'categorical_crossentropy' e.t.c and for labels using direct labels, one hot encoding, Binning the labels from [kernal](https://www.kaggle.com/haqishen/train-efficientnet-b0-w-36-tiles-256-lb0-87/data). \nNow I got confused how to choose loss function, activation function and matrices based on how labels are used.\nAlso how to use 'quadratic weighted kappa' as a loss function to optimize model instead of just tracking qwk score.\n\nThanks",
    "892116": "Cross entropy =&gt; Label must be class integer (or one hot in some cases). Read the doc of the loss you are using. If you use pytorch cross entropy loss then label is class integer.\nBinary Cross entropy =&gt; This suggest the binning approach in one of the top kernel. Label must be [1, 1, 0, 0, 0] for class 2 for example.\nMSE =&gt; Label must be class integer (cast as float)."
  }
}