{
  "id": 206056,
  "title": "Using the class_weight argument in tf.keras.model.fit",
  "url": "/competitions/ranzcr-clip-catheter-line-classification/discussion/206056",
  "author_name": "Spiro",
  "post_date": "2020-12-23T02:12:48.624000",
  "votes": 0,
  "comment_count": 0,
  "views": 0,
  "content": "<p>Hello,</p>\n<p>Could someone please help me understand the class_weight argument in tf.keras.model.fit()? </p>\n<p>The documentation says:  </p>\n<blockquote>\n  <p>Optional dictionary mapping class indices (integers) to a weight (float) value, used for weighting the loss function (during training only). This can be useful to tell the model to \"pay more attention\" to samples from an under-represented class.</p>\n  <p><a href=\"https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit\" target=\"_blank\"> https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit</a></p>\n</blockquote>\n<p>Can this be used for multi-label classification problems like RANZCR CLiP?  How?</p>",
  "messages": [
    {
      "id": 1123180,
      "postDate": "2020-12-23T02:12:48.623Z",
      "content": "<p>Hello,</p>\n<p>Could someone please help me understand the class_weight argument in tf.keras.model.fit()? </p>\n<p>The documentation says:  </p>\n<blockquote>\n  <p>Optional dictionary mapping class indices (integers) to a weight (float) value, used for weighting the loss function (during training only). This can be useful to tell the model to \"pay more attention\" to samples from an under-represented class.</p>\n  <p><a href=\"https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit\" target=\"_blank\"> https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit</a></p>\n</blockquote>\n<p>Can this be used for multi-label classification problems like RANZCR CLiP?  How?</p>",
      "rawMarkdown": "Hello,\n\nCould someone please help me understand the class_weight argument in tf.keras.model.fit()? \n\nThe documentation says:  \n> Optional dictionary mapping class indices (integers) to a weight (float) value, used for weighting the loss function (during training only). This can be useful to tell the model to \"pay more attention\" to samples from an under-represented class.\n> \n> [ https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit]( https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit)\n\n\nCan this be used for multi-label classification problems like RANZCR CLiP?  How?\n\n"
    }
  ],
  "comments": [],
  "raw_markdown_by_id": {
    "1123180": "Hello,\n\nCould someone please help me understand the class_weight argument in tf.keras.model.fit()? \n\nThe documentation says:  \n> Optional dictionary mapping class indices (integers) to a weight (float) value, used for weighting the loss function (during training only). This can be useful to tell the model to \"pay more attention\" to samples from an under-represented class.\n> \n> [ https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit]( https://www.tensorflow.org/api_docs/python/tf/keras/Model#fit)\n\n\nCan this be used for multi-label classification problems like RANZCR CLiP?  How?\n\n"
  }
}