{
  "id": 98239,
  "title": "Regression vs Classification ? ",
  "url": "/competitions/aptos2019-blindness-detection/discussion/98239",
  "author_name": "",
  "post_date": "2019-07-02T08:31:08.212960500Z",
  "votes": 18,
  "comment_count": 30,
  "views": 0,
  "content": "<p>Are you considering the problem as an regression or a classification problem? </p>",
  "messages": [
    {
      "id": "566492",
      "postDate": "07/02/2019 08:31:08",
      "content": "<p>Are you considering the problem as an regression or a classification problem? </p>",
      "rawMarkdown": "Are you considering the problem as an regression or a classification problem?",
      "votes": null
    },
    {
      "id": "566506",
      "postDate": "07/02/2019 08:51:50",
      "content": "<p>Well i don't know if it's correct, of course, but i think is a classification problem. Probably a boolean ( not diabetic or diabetic) but is about predicting a label so classification is the answer imho</p>",
      "rawMarkdown": "Well i don't know if it's correct, of course, but i think is a classification problem. Probably a boolean ( not diabetic or diabetic) but is about predicting a label so classification is the answer imho",
      "votes": null
    },
    {
      "id": "566520",
      "postDate": "07/02/2019 09:10:54",
      "content": "<p>it is a classification problem because you provided discrete value (severity of diabetic retinopathy on a scale of 0 to 4).</p>",
      "rawMarkdown": "it is a classification problem because you provided discrete value (severity of diabetic retinopathy on a scale of 0 to 4).",
      "votes": null
    },
    {
      "id": "566531",
      "postDate": "07/02/2019 09:21:17",
      "content": "<p>I think the same too. Pretty sure is a multi-classification task ;)</p>",
      "rawMarkdown": "I think the same too. Pretty sure is a multi-classification task ;)",
      "votes": null
    },
    {
      "id": "566539",
      "postDate": "07/02/2019 09:33:57",
      "content": "<p>It's like predicting a rating for the severity of the disease. I think we can treat it as a regression problem and then we can map the predicted values to the classes. </p>",
      "rawMarkdown": "It's like predicting a rating for the severity of the disease. I think we can treat it as a regression problem and then we can map the predicted values to the classes.",
      "votes": null
    },
    {
      "id": "566543",
      "postDate": "07/02/2019 09:38:29",
      "content": "<p>I think itz oridinal regression problem!! The labels[0-4] have orders, which is different from classification problems</p>",
      "rawMarkdown": "I think itz oridinal regression problem!! The labels[0-4] have orders, which is different from classification problems",
      "votes": null
    },
    {
      "id": "566573",
      "postDate": "07/02/2019 10:36:36",
      "content": "<p>Usually, your output will be a vector of real numbers. After that, you may apply <a href=\"https://en.wikipedia.org/wiki/Softmax_function\">softmax</a> function to convert them in probabilities.\nFinally, you can take the class with higher prob as your prediction for that record :)</p>\n\n<p>Here is also a cool pic from <a href=\"https://www.youtube.com/watch?v=lvNdl7yg4Pg\">https://www.youtube.com/watch?v=lvNdl7yg4Pg</a>\n<img src=\"https://i.ytimg.com/vi/lvNdl7yg4Pg/maxresdefault.jpg\" alt=\"Softmax\"></p>",
      "rawMarkdown": "Usually, your output will be a vector of real numbers. After that, you may apply [softmax](https://en.wikipedia.org/wiki/Softmax_function) function to convert them in probabilities.\nFinally, you can take the class with higher prob as your prediction for that record :)\n\nHere is also a cool pic from https://www.youtube.com/watch?v=lvNdl7yg4Pg\n![Softmax](https://i.ytimg.com/vi/lvNdl7yg4Pg/maxresdefault.jpg)",
      "votes": null
    },
    {
      "id": "566577",
      "postDate": "07/02/2019 10:40:29",
      "content": "<p><a href=\"/rinnqd\">@rinnqd</a> \nnote: I am aware that you may already know this :smile:\nIt could be useful for other people reading this topic :)</p>",
      "rawMarkdown": "rinnqd \nnote: I am aware that you may already know this :smile:\nIt could be useful for other people reading this topic :)",
      "votes": null
    },
    {
      "id": "566589",
      "postDate": "07/02/2019 10:54:06",
      "content": "<p>Yeah thank you for the explanation ! This could be helpful for many new Kagglers here</p>",
      "rawMarkdown": "Yeah thank you for the explanation ! This could be helpful for many new Kagglers here",
      "votes": null
    },
    {
      "id": "566621",
      "postDate": "07/02/2019 11:30:47",
      "content": "<p>Its regression problem as classes follow a order. They depend on each other relatively. Not like imagenet where all 1000\nclasses are independent.\nLet say prediction of cancer level is 3.5; if it were a multi class classification, this doesn't mean anything; as there's no class as such.\nBut for regression, we <strong>can</strong> say, its higher than 3, lower than 4. We're getting information there.\nJust because labels are integers doesn't mean its classification.</p>\n\n<p>In that way, if we just floor or ceil out targets of any regression task, would it become multi-class classification?</p>",
      "rawMarkdown": "Its regression problem as classes follow a order. They depend on each other relatively. Not like imagenet where all 1000\nclasses are independent.\nLet say prediction of cancer level is 3.5; if it were a multi class classification, this doesn't mean anything; as there's no class as such.\nBut for regression, we **can** say, its higher than 3, lower than 4. We're getting information there.\nJust because labels are integers doesn't mean its classification.\n\nIn that way, if we just floor or ceil out targets of any regression task, would it become multi-class classification?",
      "votes": null
    },
    {
      "id": "566676",
      "postDate": "07/02/2019 12:53:52",
      "content": "<p>I see your point and it makes totally sense.  In my previous comments, I assumed that we had only 4 classes representing stages of illness.\nActually, I didn't think about the order :)\nTo consider it a regression problem, the distance between the classes should be the same, right? What if <code>Moderate to Severe</code> distance is different from <code>Severe to Proliferative DR</code> one. Many algorithms may have problems with that I think.</p>\n\n<p>IMHO, both approaches could work and we should try those. What do you think?</p>",
      "rawMarkdown": "I see your point and it makes totally sense.  In my previous comments, I assumed that we had only 4 classes representing stages of illness.\nActually, I didn't think about the order :)\nTo consider it a regression problem, the distance between the classes should be the same, right? What if `Moderate to Severe` distance is different from `Severe to Proliferative DR` one. Many algorithms may have problems with that I think.\n\nIMHO, both approaches could work and we should try those. What do you think?",
      "votes": null
    },
    {
      "id": "566787",
      "postDate": "07/02/2019 15:39:13",
      "content": "<p>For others who are interested: <a href=\"https://towardsdatascience.com/simple-trick-to-train-an-ordinal-regression-with-any-classifier-6911183d2a3c\">https://towardsdatascience.com/simple-trick-to-train-an-ordinal-regression-with-any-classifier-6911183d2a3c</a></p>",
      "rawMarkdown": "For others who are interested: https://towardsdatascience.com/simple-trick-to-train-an-ordinal-regression-with-any-classifier-6911183d2a3c",
      "votes": null
    },
    {
      "id": "566842",
      "postDate": "07/02/2019 16:45:34",
      "content": "<p>Those stages of cancer (i.e. lebels) are designed by us. \nSo, we can make it like <code>Moderate to Severe</code> &amp; <code>Severe to Proliferative DR</code> distances are same to overcome limitations of algorithms if any.\nLet say, distance in <code>Moderate to Severe</code> half of <code>Severe to Proliferative DR</code>. Well, we can label them in such way, they become equal.\nLike <code>{moderate : 3, severe : 9, Proliferative DR : 12}</code></p>\n\n<p>Yes. Both approach can work. But I think using regression logically makes sense.\nIf we think, stage will rarely be an integer. Most likely it will be a float. \nLet say, today a patient have stage 2.0 &amp; after a year he/she have stage 3.0. \nWhat happened in that year? 2.1, 2.2 ... 2.9, 3.0. It gradually goes to 3.0 not directly.\nWhen patient goes to doctor in that year, he/she might be in stage 2.5 !! \nIts the doctor who decides whether to label it 2 or 3.</p>",
      "rawMarkdown": "Those stages of cancer (i.e. lebels) are designed by us. \nSo, we can make it like `Moderate to Severe` &amp; `Severe to Proliferative DR` distances are same to overcome limitations of algorithms if any.\nLet say, distance in `Moderate to Severe` half of `Severe to Proliferative DR`. Well, we can label them in such way, they become equal.\nLike `{moderate : 3, severe : 9, Proliferative DR : 12}`\n\nYes. Both approach can work. But I think using regression logically makes sense.\nIf we think, stage will rarely be an integer. Most likely it will be a float. \nLet say, today a patient have stage 2.0 &amp; after a year he/she have stage 3.0. \nWhat happened in that year? 2.1, 2.2 ... 2.9, 3.0. It gradually goes to 3.0 not directly.\nWhen patient goes to doctor in that year, he/she might be in stage 2.5 !! \nIts the doctor who decides whether to label it 2 or 3.",
      "votes": null
    },
    {
      "id": "567099",
      "postDate": "07/03/2019 04:05:56",
      "content": "<p>It's definitely ordinal regression. ;)</p>",
      "rawMarkdown": "It's definitely ordinal regression. ;)",
      "votes": null
    },
    {
      "id": "567119",
      "postDate": "07/03/2019 04:55:33",
      "content": "<p>Neural networks can directly handle ordinal regression by using 5 output neurons(maybe) and encoding classes as:\n<code>\n0: [0 0 0 0 0]\n1: [1 0 0 0 0]\n2: [1 1 0 0 0]\n3: [1 1 1 0 0]\n4: [1 1 1 1 0]\n5: [1 1 1 1 1]\n</code>\n<a href=\"https://stats.stackexchange.com/questions/140061/how-to-set-up-neural-network-to-output-ordinal-data\">Reference</a></p>",
      "rawMarkdown": "Neural networks can directly handle ordinal regression by using 5 output neurons(maybe) and encoding classes as:\n```\n0: [0 0 0 0 0]\n1: [1 0 0 0 0]\n2: [1 1 0 0 0]\n3: [1 1 1 0 0]\n4: [1 1 1 1 0]\n5: [1 1 1 1 1]\n```\n[Reference](https://stats.stackexchange.com/questions/140061/how-to-set-up-neural-network-to-output-ordinal-data)",
      "votes": null
    },
    {
      "id": "567137",
      "postDate": "07/03/2019 05:17:47",
      "content": "<p>Certainly, the problem is a categorical classification one. But yes, if you could publish a kernel that treats outputs as a regression problem, it would be highly appreciated. All you have to do is use *sparse_categorical_crossentropy* instead if working with Keras. </p>",
      "rawMarkdown": "Certainly, the problem is a categorical classification one. But yes, if you could publish a kernel that treats outputs as a regression problem, it would be highly appreciated. All you have to do is use *sparse_categorical_crossentropy* instead if working with Keras.",
      "votes": null
    },
    {
      "id": "567142",
      "postDate": "07/03/2019 05:24:03",
      "content": "<p>Hi! <a href=\"/rinnqd\">@rinnqd</a> I'm considering this problem as a Multiclass Classification</p>",
      "rawMarkdown": "Hi! @rinnqd I'm considering this problem as a Multiclass Classification",
      "votes": null
    },
    {
      "id": "567159",
      "postDate": "07/03/2019 05:58:57",
      "content": "<p><a href=\"https://www.kaggle.com/c/petfinder-adoption-prediction\">PetFinder competition</a> also used kappa for metrics. <br>\nOur team used only regression and other top teams used both;)</p>",
      "rawMarkdown": "[PetFinder competition](https://www.kaggle.com/c/petfinder-adoption-prediction) also used kappa for metrics.  \nOur team used only regression and other top teams used both;)",
      "votes": null
    },
    {
      "id": "567200",
      "postDate": "07/03/2019 07:03:04",
      "content": "<p>Thanks for the explanation! It makes sense and, for sure, I m going to try both approaches :)</p>",
      "rawMarkdown": "Thanks for the explanation! It makes sense and, for sure, I m going to try both approaches :)",
      "votes": null
    },
    {
      "id": "567233",
      "postDate": "07/03/2019 07:48:54",
      "content": "<p>You're welcome!</p>",
      "rawMarkdown": "You're welcome!",
      "votes": null
    },
    {
      "id": "567746",
      "postDate": "07/04/2019 00:42:48",
      "content": "<p>I think problem is this weird classification of eye damage. It more looks like doctor's opinion. If we have something like - one vessel blocked- level one, two - level two, or, for example, depending on size of defect. In this case it would looks like science. What I want to say, if you have objective data, like let say blood pressure in numbers, you are on the solid science ground. Otherwise it looks like shaman ritual - what seems to one doctor as stage 2, may be considered as 3 by another person.  And you may perfect your model, but you have guess this doctor preference and previous data may be useless. Little bit strange.</p>",
      "rawMarkdown": "I think problem is this weird classification of eye damage. It more looks like doctor's opinion. If we have something like - one vessel blocked- level one, two - level two, or, for example, depending on size of defect. In this case it would looks like science. What I want to say, if you have objective data, like let say blood pressure in numbers, you are on the solid science ground. Otherwise it looks like shaman ritual - what seems to one doctor as stage 2, may be considered as 3 by another person.  And you may perfect your model, but you have guess this doctor preference and previous data may be useless. Little bit strange.",
      "votes": null
    },
    {
      "id": "568505",
      "postDate": "07/05/2019 03:07:51",
      "content": "<p>I think regression should be better.</p>",
      "rawMarkdown": "I think regression should be better.",
      "votes": null
    },
    {
      "id": "569525",
      "postDate": "07/06/2019 20:07:14",
      "content": "<p>I think its a regression problem</p>",
      "rawMarkdown": "I think its a regression problem",
      "votes": null
    },
    {
      "id": "569618",
      "postDate": "07/07/2019 03:12:03",
      "content": "<p>I think regression problem.</p>",
      "rawMarkdown": "I think regression problem.",
      "votes": null
    },
    {
      "id": "569772",
      "postDate": "07/07/2019 09:47:58",
      "content": "<p>Regression seems to be better in this problem.</p>",
      "rawMarkdown": "Regression seems to be better in this problem.",
      "votes": null
    },
    {
      "id": "573175",
      "postDate": "07/11/2019 22:08:55",
      "content": "<p>Some ideas on how to treat this as ordinal regression: <a href=\"https://www.kaggle.com/c/aptos2019-blindness-detection/discussion/97893#latest-566307\">https://www.kaggle.com/c/aptos2019-blindness-detection/discussion/97893#latest-566307</a></p>",
      "rawMarkdown": "Some ideas on how to treat this as ordinal regression: https://www.kaggle.com/c/aptos2019-blindness-detection/discussion/97893#latest-566307",
      "votes": null
    },
    {
      "id": "573709",
      "postDate": "07/12/2019 16:34:45",
      "content": "<p>IMO, due to the nature of the meaningful ordering of the labels, the task would be a good fit for ordinal regression. </p>",
      "rawMarkdown": "IMO, due to the nature of the meaningful ordering of the labels, the task would be a good fit for ordinal regression.",
      "votes": null
    },
    {
      "id": "573991",
      "postDate": "07/13/2019 05:08:45",
      "content": "<p>I am considering this a classification problem. </p>",
      "rawMarkdown": "I am considering this a classification problem.",
      "votes": null
    },
    {
      "id": "577664",
      "postDate": "07/16/2019 23:08:46",
      "content": "<p>Is there a way we can use LSTM on this dataset to generate the captions for the images?</p>",
      "rawMarkdown": "Is there a way we can use LSTM on this dataset to generate the captions for the images?",
      "votes": null
    },
    {
      "id": "591005",
      "postDate": "08/03/2019 02:32:01",
      "content": "<p>They use quadratic weighted kappa as evaluation metric, which is closely related to mean squared error. If ground truth label is 0, it's better to predict 1 (which results in penalty of 1) than to predict 4 (which results in penalty of 16!). I don't see how classification can address this problem. Regression (minimizing mse) really suit this problem logically. </p>",
      "rawMarkdown": "They use quadratic weighted kappa as evaluation metric, which is closely related to mean squared error. If ground truth label is 0, it's better to predict 1 (which results in penalty of 1) than to predict 4 (which results in penalty of 16!). I don't see how classification can address this problem. Regression (minimizing mse) really suit this problem logically.",
      "votes": null
    },
    {
      "id": "2410836",
      "postDate": "08/27/2023 08:27:27",
      "content": "<p>It is a regression problem as labels are in ordinal form.</p>",
      "rawMarkdown": "It is a regression problem as labels are in ordinal form.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2410836,
      "author_name": "thjamali",
      "author_url": "",
      "post_date": "08/27/2023 08:27:27",
      "content": "<p>It is a regression problem as labels are in ordinal form.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 566506,
      "author_name": "firefox1616",
      "author_url": "",
      "post_date": "07/02/2019 08:51:50",
      "content": "<p>Well i don't know if it's correct, of course, but i think is a classification problem. Probably a boolean ( not diabetic or diabetic) but is about predicting a label so classification is the answer imho</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 566520,
      "author_name": "projdev",
      "author_url": "",
      "post_date": "07/02/2019 09:10:54",
      "content": "<p>it is a classification problem because you provided discrete value (severity of diabetic retinopathy on a scale of 0 to 4).</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 566531,
      "author_name": "raimonds1993",
      "author_url": "",
      "post_date": "07/02/2019 09:21:17",
      "content": "<p>I think the same too. Pretty sure is a multi-classification task ;)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 566539,
      "author_name": "rinnqd",
      "author_url": "",
      "post_date": "07/02/2019 09:33:57",
      "content": "<p>It's like predicting a rating for the severity of the disease. I think we can treat it as a regression problem and then we can map the predicted values to the classes. </p>",
      "votes": null,
      "replies": [
        {
          "id": 566573,
          "author_name": "raimonds1993",
          "author_url": "",
          "post_date": "07/02/2019 10:36:36",
          "content": "<p>Usually, your output will be a vector of real numbers. After that, you may apply <a href=\"https://en.wikipedia.org/wiki/Softmax_function\">softmax</a> function to convert them in probabilities.\nFinally, you can take the class with higher prob as your prediction for that record :)</p>\n\n<p>Here is also a cool pic from <a href=\"https://www.youtube.com/watch?v=lvNdl7yg4Pg\">https://www.youtube.com/watch?v=lvNdl7yg4Pg</a>\n<img src=\"https://i.ytimg.com/vi/lvNdl7yg4Pg/maxresdefault.jpg\" alt=\"Softmax\"></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 566577,
          "author_name": "raimonds1993",
          "author_url": "",
          "post_date": "07/02/2019 10:40:29",
          "content": "<p><a href=\"/rinnqd\">@rinnqd</a> \nnote: I am aware that you may already know this :smile:\nIt could be useful for other people reading this topic :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 566589,
          "author_name": "rinnqd",
          "author_url": "",
          "post_date": "07/02/2019 10:54:06",
          "content": "<p>Yeah thank you for the explanation ! This could be helpful for many new Kagglers here</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 566543,
      "author_name": "bibek777",
      "author_url": "",
      "post_date": "07/02/2019 09:38:29",
      "content": "<p>I think itz oridinal regression problem!! The labels[0-4] have orders, which is different from classification problems</p>",
      "votes": null,
      "replies": [
        {
          "id": 566787,
          "author_name": "tyleryep",
          "author_url": "",
          "post_date": "07/02/2019 15:39:13",
          "content": "<p>For others who are interested: <a href=\"https://towardsdatascience.com/simple-trick-to-train-an-ordinal-regression-with-any-classifier-6911183d2a3c\">https://towardsdatascience.com/simple-trick-to-train-an-ordinal-regression-with-any-classifier-6911183d2a3c</a></p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 566621,
      "author_name": "prashantkikani",
      "author_url": "",
      "post_date": "07/02/2019 11:30:47",
      "content": "<p>Its regression problem as classes follow a order. They depend on each other relatively. Not like imagenet where all 1000\nclasses are independent.\nLet say prediction of cancer level is 3.5; if it were a multi class classification, this doesn't mean anything; as there's no class as such.\nBut for regression, we <strong>can</strong> say, its higher than 3, lower than 4. We're getting information there.\nJust because labels are integers doesn't mean its classification.</p>\n\n<p>In that way, if we just floor or ceil out targets of any regression task, would it become multi-class classification?</p>",
      "votes": null,
      "replies": [
        {
          "id": 566676,
          "author_name": "raimonds1993",
          "author_url": "",
          "post_date": "07/02/2019 12:53:52",
          "content": "<p>I see your point and it makes totally sense.  In my previous comments, I assumed that we had only 4 classes representing stages of illness.\nActually, I didn't think about the order :)\nTo consider it a regression problem, the distance between the classes should be the same, right? What if <code>Moderate to Severe</code> distance is different from <code>Severe to Proliferative DR</code> one. Many algorithms may have problems with that I think.</p>\n\n<p>IMHO, both approaches could work and we should try those. What do you think?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 566842,
          "author_name": "prashantkikani",
          "author_url": "",
          "post_date": "07/02/2019 16:45:34",
          "content": "<p>Those stages of cancer (i.e. lebels) are designed by us. \nSo, we can make it like <code>Moderate to Severe</code> &amp; <code>Severe to Proliferative DR</code> distances are same to overcome limitations of algorithms if any.\nLet say, distance in <code>Moderate to Severe</code> half of <code>Severe to Proliferative DR</code>. Well, we can label them in such way, they become equal.\nLike <code>{moderate : 3, severe : 9, Proliferative DR : 12}</code></p>\n\n<p>Yes. Both approach can work. But I think using regression logically makes sense.\nIf we think, stage will rarely be an integer. Most likely it will be a float. \nLet say, today a patient have stage 2.0 &amp; after a year he/she have stage 3.0. \nWhat happened in that year? 2.1, 2.2 ... 2.9, 3.0. It gradually goes to 3.0 not directly.\nWhen patient goes to doctor in that year, he/she might be in stage 2.5 !! \nIts the doctor who decides whether to label it 2 or 3.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 567200,
          "author_name": "raimonds1993",
          "author_url": "",
          "post_date": "07/03/2019 07:03:04",
          "content": "<p>Thanks for the explanation! It makes sense and, for sure, I m going to try both approaches :)</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 567233,
          "author_name": "prashantkikani",
          "author_url": "",
          "post_date": "07/03/2019 07:48:54",
          "content": "<p>You're welcome!</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 567099,
      "author_name": "puremath86",
      "author_url": "",
      "post_date": "07/03/2019 04:05:56",
      "content": "<p>It's definitely ordinal regression. ;)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 567119,
      "author_name": "adityaecdrid",
      "author_url": "",
      "post_date": "07/03/2019 04:55:33",
      "content": "<p>Neural networks can directly handle ordinal regression by using 5 output neurons(maybe) and encoding classes as:\n<code>\n0: [0 0 0 0 0]\n1: [1 0 0 0 0]\n2: [1 1 0 0 0]\n3: [1 1 1 0 0]\n4: [1 1 1 1 0]\n5: [1 1 1 1 1]\n</code>\n<a href=\"https://stats.stackexchange.com/questions/140061/how-to-set-up-neural-network-to-output-ordinal-data\">Reference</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 567137,
      "author_name": "thanatoz",
      "author_url": "",
      "post_date": "07/03/2019 05:17:47",
      "content": "<p>Certainly, the problem is a categorical classification one. But yes, if you could publish a kernel that treats outputs as a regression problem, it would be highly appreciated. All you have to do is use *sparse_categorical_crossentropy* instead if working with Keras. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 567142,
      "author_name": "cv13j0",
      "author_url": "",
      "post_date": "07/03/2019 05:24:03",
      "content": "<p>Hi! <a href=\"/rinnqd\">@rinnqd</a> I'm considering this problem as a Multiclass Classification</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 567159,
      "author_name": "takuok",
      "author_url": "",
      "post_date": "07/03/2019 05:58:57",
      "content": "<p><a href=\"https://www.kaggle.com/c/petfinder-adoption-prediction\">PetFinder competition</a> also used kappa for metrics. <br>\nOur team used only regression and other top teams used both;)</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 567746,
      "author_name": "serg132003",
      "author_url": "",
      "post_date": "07/04/2019 00:42:48",
      "content": "<p>I think problem is this weird classification of eye damage. It more looks like doctor's opinion. If we have something like - one vessel blocked- level one, two - level two, or, for example, depending on size of defect. In this case it would looks like science. What I want to say, if you have objective data, like let say blood pressure in numbers, you are on the solid science ground. Otherwise it looks like shaman ritual - what seems to one doctor as stage 2, may be considered as 3 by another person.  And you may perfect your model, but you have guess this doctor preference and previous data may be useless. Little bit strange.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 568505,
      "author_name": "jionie",
      "author_url": "",
      "post_date": "07/05/2019 03:07:51",
      "content": "<p>I think regression should be better.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 569525,
      "author_name": "danish788",
      "author_url": "",
      "post_date": "07/06/2019 20:07:14",
      "content": "<p>I think its a regression problem</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 569618,
      "author_name": "snakayama",
      "author_url": "",
      "post_date": "07/07/2019 03:12:03",
      "content": "<p>I think regression problem.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 569772,
      "author_name": "ensangjeon",
      "author_url": "",
      "post_date": "07/07/2019 09:47:58",
      "content": "<p>Regression seems to be better in this problem.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 573175,
      "author_name": "robertburbidge",
      "author_url": "",
      "post_date": "07/11/2019 22:08:55",
      "content": "<p>Some ideas on how to treat this as ordinal regression: <a href=\"https://www.kaggle.com/c/aptos2019-blindness-detection/discussion/97893#latest-566307\">https://www.kaggle.com/c/aptos2019-blindness-detection/discussion/97893#latest-566307</a></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 573709,
      "author_name": "kaandonbekci",
      "author_url": "",
      "post_date": "07/12/2019 16:34:45",
      "content": "<p>IMO, due to the nature of the meaningful ordering of the labels, the task would be a good fit for ordinal regression. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 573991,
      "author_name": "ankittomar1",
      "author_url": "",
      "post_date": "07/13/2019 05:08:45",
      "content": "<p>I am considering this a classification problem. </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 577664,
      "author_name": "vrenur",
      "author_url": "",
      "post_date": "07/16/2019 23:08:46",
      "content": "<p>Is there a way we can use LSTM on this dataset to generate the captions for the images?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 591005,
      "author_name": "quandapro",
      "author_url": "",
      "post_date": "08/03/2019 02:32:01",
      "content": "<p>They use quadratic weighted kappa as evaluation metric, which is closely related to mean squared error. If ground truth label is 0, it's better to predict 1 (which results in penalty of 1) than to predict 4 (which results in penalty of 16!). I don't see how classification can address this problem. Regression (minimizing mse) really suit this problem logically. </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "566492": "Are you considering the problem as an regression or a classification problem?",
    "566506": "Well i don't know if it's correct, of course, but i think is a classification problem. Probably a boolean ( not diabetic or diabetic) but is about predicting a label so classification is the answer imho",
    "566520": "it is a classification problem because you provided discrete value (severity of diabetic retinopathy on a scale of 0 to 4).",
    "566531": "I think the same too. Pretty sure is a multi-classification task ;)",
    "566539": "It's like predicting a rating for the severity of the disease. I think we can treat it as a regression problem and then we can map the predicted values to the classes.",
    "566543": "I think itz oridinal regression problem!! The labels[0-4] have orders, which is different from classification problems",
    "566573": "Usually, your output will be a vector of real numbers. After that, you may apply [softmax](https://en.wikipedia.org/wiki/Softmax_function) function to convert them in probabilities.\nFinally, you can take the class with higher prob as your prediction for that record :)\n\nHere is also a cool pic from https://www.youtube.com/watch?v=lvNdl7yg4Pg\n![Softmax](https://i.ytimg.com/vi/lvNdl7yg4Pg/maxresdefault.jpg)",
    "566577": "rinnqd \nnote: I am aware that you may already know this :smile:\nIt could be useful for other people reading this topic :)",
    "566589": "Yeah thank you for the explanation ! This could be helpful for many new Kagglers here",
    "566621": "Its regression problem as classes follow a order. They depend on each other relatively. Not like imagenet where all 1000\nclasses are independent.\nLet say prediction of cancer level is 3.5; if it were a multi class classification, this doesn't mean anything; as there's no class as such.\nBut for regression, we **can** say, its higher than 3, lower than 4. We're getting information there.\nJust because labels are integers doesn't mean its classification.\n\nIn that way, if we just floor or ceil out targets of any regression task, would it become multi-class classification?",
    "566676": "I see your point and it makes totally sense.  In my previous comments, I assumed that we had only 4 classes representing stages of illness.\nActually, I didn't think about the order :)\nTo consider it a regression problem, the distance between the classes should be the same, right? What if `Moderate to Severe` distance is different from `Severe to Proliferative DR` one. Many algorithms may have problems with that I think.\n\nIMHO, both approaches could work and we should try those. What do you think?",
    "566787": "For others who are interested: https://towardsdatascience.com/simple-trick-to-train-an-ordinal-regression-with-any-classifier-6911183d2a3c",
    "566842": "Those stages of cancer (i.e. lebels) are designed by us. \nSo, we can make it like `Moderate to Severe` &amp; `Severe to Proliferative DR` distances are same to overcome limitations of algorithms if any.\nLet say, distance in `Moderate to Severe` half of `Severe to Proliferative DR`. Well, we can label them in such way, they become equal.\nLike `{moderate : 3, severe : 9, Proliferative DR : 12}`\n\nYes. Both approach can work. But I think using regression logically makes sense.\nIf we think, stage will rarely be an integer. Most likely it will be a float. \nLet say, today a patient have stage 2.0 &amp; after a year he/she have stage 3.0. \nWhat happened in that year? 2.1, 2.2 ... 2.9, 3.0. It gradually goes to 3.0 not directly.\nWhen patient goes to doctor in that year, he/she might be in stage 2.5 !! \nIts the doctor who decides whether to label it 2 or 3.",
    "567099": "It's definitely ordinal regression. ;)",
    "567119": "Neural networks can directly handle ordinal regression by using 5 output neurons(maybe) and encoding classes as:\n```\n0: [0 0 0 0 0]\n1: [1 0 0 0 0]\n2: [1 1 0 0 0]\n3: [1 1 1 0 0]\n4: [1 1 1 1 0]\n5: [1 1 1 1 1]\n```\n[Reference](https://stats.stackexchange.com/questions/140061/how-to-set-up-neural-network-to-output-ordinal-data)",
    "567137": "Certainly, the problem is a categorical classification one. But yes, if you could publish a kernel that treats outputs as a regression problem, it would be highly appreciated. All you have to do is use *sparse_categorical_crossentropy* instead if working with Keras.",
    "567142": "Hi! @rinnqd I'm considering this problem as a Multiclass Classification",
    "567159": "[PetFinder competition](https://www.kaggle.com/c/petfinder-adoption-prediction) also used kappa for metrics.  \nOur team used only regression and other top teams used both;)",
    "567200": "Thanks for the explanation! It makes sense and, for sure, I m going to try both approaches :)",
    "567233": "You're welcome!",
    "567746": "I think problem is this weird classification of eye damage. It more looks like doctor's opinion. If we have something like - one vessel blocked- level one, two - level two, or, for example, depending on size of defect. In this case it would looks like science. What I want to say, if you have objective data, like let say blood pressure in numbers, you are on the solid science ground. Otherwise it looks like shaman ritual - what seems to one doctor as stage 2, may be considered as 3 by another person.  And you may perfect your model, but you have guess this doctor preference and previous data may be useless. Little bit strange.",
    "568505": "I think regression should be better.",
    "569525": "I think its a regression problem",
    "569618": "I think regression problem.",
    "569772": "Regression seems to be better in this problem.",
    "573175": "Some ideas on how to treat this as ordinal regression: https://www.kaggle.com/c/aptos2019-blindness-detection/discussion/97893#latest-566307",
    "573709": "IMO, due to the nature of the meaningful ordering of the labels, the task would be a good fit for ordinal regression.",
    "573991": "I am considering this a classification problem.",
    "577664": "Is there a way we can use LSTM on this dataset to generate the captions for the images?",
    "591005": "They use quadratic weighted kappa as evaluation metric, which is closely related to mean squared error. If ground truth label is 0, it's better to predict 1 (which results in penalty of 1) than to predict 4 (which results in penalty of 16!). I don't see how classification can address this problem. Regression (minimizing mse) really suit this problem logically.",
    "2410836": "It is a regression problem as labels are in ordinal form."
  },
  "source": "meta"
}