{
  "id": 159159,
  "title": "can you please help to get the metric in tensorflow",
  "url": "/competitions/alaska2-image-steganalysis/discussion/159159",
  "author_name": "Uday Kumar Gurugubelli",
  "post_date": "2020-06-16T15:31:35.055000",
  "votes": 1,
  "comment_count": 6,
  "views": 0,
  "content": "",
  "messages": [
    {
      "id": 888835,
      "postDate": "2020-06-16T15:31:35.057Z",
      "rawMarkdown": "",
      "votes": 1
    },
    {
      "id": 889923,
      "postDate": "2020-06-17T08:03:56.330Z",
      "content": "<p>I don't think what you have above will work. The thresholds argument specifies how you should discretise the curve so auc1 will still be the area calculated from 0-1. auc1 and auc2 will be the same value from the way you've defined them. This is how i understand the documentation but correct me if i'm wrong. </p>\n\n<p>Also i'm not sure the tf.keras.metrics.AUC will work for this. I think you will need to write a custom metric which i'm currently struggling with myself. </p>",
      "rawMarkdown": "I don't think what you have above will work. The thresholds argument specifies how you should discretise the curve so auc1 will still be the area calculated from 0-1. auc1 and auc2 will be the same value from the way you've defined them. This is how i understand the documentation but correct me if i'm wrong. \n\nAlso i'm not sure the tf.keras.metrics.AUC will work for this. I think you will need to write a custom metric which i'm currently struggling with myself. ",
      "replies": [
        {
          "id": 890371,
          "postDate": "2020-06-17T13:27:55.177Z",
          "content": "<p>thanks for reply. yah..thats right..i tried to implement it using sklearn. but converting y_true and y_pred from tensors becoming problem..dont know how to handle</p>",
          "rawMarkdown": "thanks for reply. yah..thats right..i tried to implement it using sklearn. but converting y_true and y_pred from tensors becoming problem..dont know how to handle"
        }
      ]
    },
    {
      "id": 889753,
      "postDate": "2020-06-17T05:40:43.587Z",
      "content": "<p>auc1 = tf.keras.metrics.AUC(thresholds=[0,0.4])\nauc2 = tf.keras.metrics.AUC(thresholds=[0.4,1])\nauc = (2*auc1+auc2)/3</p>\n\n<p>is this correct estimate of the metric????</p>",
      "rawMarkdown": "auc1 = tf.keras.metrics.AUC(thresholds=[0,0.4])\nauc2 = tf.keras.metrics.AUC(thresholds=[0.4,1])\nauc = (2*auc1+auc2)/3\n\nis this correct estimate of the metric????"
    },
    {
      "id": 888839,
      "postDate": "2020-06-16T15:33:01.590Z",
      "content": "<p>I tried but faced the problem when calculating roc curve with sklearn, throwing error</p>",
      "rawMarkdown": "I tried but faced the problem when calculating roc curve with sklearn, throwing error"
    },
    {
      "id": 894917,
      "postDate": "2020-06-20T22:35:01.767Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 892932,
      "postDate": "2020-06-19T09:04:05.147Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 889923,
      "author_name": "CHRIS",
      "author_url": "",
      "post_date": "2020-06-17T08:03:56.330000",
      "content": "<p>I don't think what you have above will work. The thresholds argument specifies how you should discretise the curve so auc1 will still be the area calculated from 0-1. auc1 and auc2 will be the same value from the way you've defined them. This is how i understand the documentation but correct me if i'm wrong. </p>\n\n<p>Also i'm not sure the tf.keras.metrics.AUC will work for this. I think you will need to write a custom metric which i'm currently struggling with myself. </p>",
      "votes": 0,
      "replies": [
        {
          "id": 890371,
          "author_name": "Uday Kumar Gurugubelli",
          "author_url": "",
          "post_date": "2020-06-17T13:27:55.177000",
          "content": "<p>thanks for reply. yah..thats right..i tried to implement it using sklearn. but converting y_true and y_pred from tensors becoming problem..dont know how to handle</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 889753,
      "author_name": "Uday Kumar Gurugubelli",
      "author_url": "",
      "post_date": "2020-06-17T05:40:43.587000",
      "content": "<p>auc1 = tf.keras.metrics.AUC(thresholds=[0,0.4])\nauc2 = tf.keras.metrics.AUC(thresholds=[0.4,1])\nauc = (2*auc1+auc2)/3</p>\n\n<p>is this correct estimate of the metric????</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 888839,
      "author_name": "Uday Kumar Gurugubelli",
      "author_url": "",
      "post_date": "2020-06-16T15:33:01.590000",
      "content": "<p>I tried but faced the problem when calculating roc curve with sklearn, throwing error</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 894917,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-06-20T22:35:01.767000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 892932,
      "author_name": "",
      "author_url": "",
      "post_date": "2020-06-19T09:04:05.147000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "888835": "",
    "889923": "I don't think what you have above will work. The thresholds argument specifies how you should discretise the curve so auc1 will still be the area calculated from 0-1. auc1 and auc2 will be the same value from the way you've defined them. This is how i understand the documentation but correct me if i'm wrong. \n\nAlso i'm not sure the tf.keras.metrics.AUC will work for this. I think you will need to write a custom metric which i'm currently struggling with myself. ",
    "889753": "auc1 = tf.keras.metrics.AUC(thresholds=[0,0.4])\nauc2 = tf.keras.metrics.AUC(thresholds=[0.4,1])\nauc = (2*auc1+auc2)/3\n\nis this correct estimate of the metric????",
    "888839": "I tried but faced the problem when calculating roc curve with sklearn, throwing error",
    "894917": "",
    "892932": ""
  }
}