{
  "id": 437933,
  "title": "Binary classification problem or Multilabel classification problem with class disbalance?",
  "url": "/competitions/child-mind-institute-detect-sleep-states/discussion/437933",
  "author_name": "Oleg Khudyakov",
  "post_date": "2023-09-08T18:32:08.518000",
  "votes": 6,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Greetings! </p>\n<p>I have a silly question. Do we have to solve binary classification problem or multilabel classification problem? Why am I asking such a strange  thing? I'll try to explain.</p>\n<p>If it is binary classification problem we most clear way to define initial data is to add \"sleep\" or \"awake\" column to  train_series.parquet with 0/1 or True/False value. And that is all.</p>\n<p>But we have train_events.csv file which contains 2 sorts of events - \"sleep onset\" and \"awakening\". It seems to be data for multilabel classification problem with a very very big class disbalance.</p>\n<p>What sort of problem do we have?</p>\n<p><strong>Shall we predict the state of person (sleeping or keeping awake)?</strong> In other words, we need to predict the probability of sleeping / wakefulness, and P(sleeping ) + P(wakefulness) == 1?</p>\n<p><strong>OR</strong> shall we predict the probability of sleep onset even and probability of awakening event (and both of these events are really rare and mutually exclusive)?<br>\nIn other words, <strong>do we have to find the moments of sleep onset even and awakening?</strong></p>\n<p>Sample of submission file in overview doesn't make this clear:</p>\n<blockquote>\n  <p>row_id,series_id,step,event,score<br>\n  0,038441c925bb,100,onset,0.0<br>\n  1,038441c925bb,105,wakeup,0.0<br>\n  2,03d92c9f6f8a,80,onset,0.5<br>\n  3,03d92c9f6f8a,110,wakeup,0.5<br>\n  4,0402a003dae9,90,onset,1.0<br>\n  5,0402a003dae9,120,wakeup,1.0</p>\n</blockquote>\n<p>But sample submission looks more like multilabel classification for me.</p>",
  "messages": [
    {
      "id": 2429707,
      "postDate": "2023-09-08T18:32:08.520Z",
      "content": "<p>Greetings! </p>\n<p>I have a silly question. Do we have to solve binary classification problem or multilabel classification problem? Why am I asking such a strange  thing? I'll try to explain.</p>\n<p>If it is binary classification problem we most clear way to define initial data is to add \"sleep\" or \"awake\" column to  train_series.parquet with 0/1 or True/False value. And that is all.</p>\n<p>But we have train_events.csv file which contains 2 sorts of events - \"sleep onset\" and \"awakening\". It seems to be data for multilabel classification problem with a very very big class disbalance.</p>\n<p>What sort of problem do we have?</p>\n<p><strong>Shall we predict the state of person (sleeping or keeping awake)?</strong> In other words, we need to predict the probability of sleeping / wakefulness, and P(sleeping ) + P(wakefulness) == 1?</p>\n<p><strong>OR</strong> shall we predict the probability of sleep onset even and probability of awakening event (and both of these events are really rare and mutually exclusive)?<br>\nIn other words, <strong>do we have to find the moments of sleep onset even and awakening?</strong></p>\n<p>Sample of submission file in overview doesn't make this clear:</p>\n<blockquote>\n  <p>row_id,series_id,step,event,score<br>\n  0,038441c925bb,100,onset,0.0<br>\n  1,038441c925bb,105,wakeup,0.0<br>\n  2,03d92c9f6f8a,80,onset,0.5<br>\n  3,03d92c9f6f8a,110,wakeup,0.5<br>\n  4,0402a003dae9,90,onset,1.0<br>\n  5,0402a003dae9,120,wakeup,1.0</p>\n</blockquote>\n<p>But sample submission looks more like multilabel classification for me.</p>",
      "rawMarkdown": "Greetings! \n\nI have a silly question. Do we have to solve binary classification problem or multilabel classification problem? Why am I asking such a strange  thing? I'll try to explain.\n\n\nIf it is binary classification problem we most clear way to define initial data is to add \"sleep\" or \"awake\" column to  train_series.parquet with 0/1 or True/False value. And that is all.\n\n\nBut we have train_events.csv file which contains 2 sorts of events - \"sleep onset\" and \"awakening\". It seems to be data for multilabel classification problem with a very very big class disbalance.\n\n\nWhat sort of problem do we have?\n\n**Shall we predict the state of person (sleeping or keeping awake)?** In other words, we need to predict the probability of sleeping / wakefulness, and P(sleeping ) + P(wakefulness) == 1?\n\n**OR** shall we predict the probability of sleep onset even and probability of awakening event (and both of these events are really rare and mutually exclusive)?\nIn other words, **do we have to find the moments of sleep onset even and awakening?**\n\nSample of submission file in overview doesn't make this clear:\n>row_id,series_id,step,event,score\n0,038441c925bb,100,onset,0.0\n1,038441c925bb,105,wakeup,0.0\n2,03d92c9f6f8a,80,onset,0.5\n3,03d92c9f6f8a,110,wakeup,0.5\n4,0402a003dae9,90,onset,1.0\n5,0402a003dae9,120,wakeup,1.0\n\nBut sample submission looks more like multilabel classification for me.",
      "votes": 6
    },
    {
      "id": 2431843,
      "postDate": "2023-09-10T13:05:29.970Z",
      "content": "<p>Interesting discussion.</p>\n<p>I'd like to share my two thoughts about how to frame the problem:</p>\n<ol>\n<li><p>Multiclass classification: each time step belong to one of these 3 classes: onset, awake, and not both. The challenge for this scheme is that the dataset will be heavily imbalanced to \"not both\" class as the majority.</p></li>\n<li><p>Binary classification: for each timestep starting from an \"onset\" to the next closest \"awake\", this timestep is classified as \"onset\". Other than that, it will be \"awake\".</p></li>\n</ol>\n<p>The 2nd strategy will result in imbalanced dataset as well but much more balanced than the 1st one.</p>\n<p>I have an experience of solving similar event detection task, specifically in earthquake phase picking, and it results that the 2nd strategy is much more easier for the model to solve rather than the 1st.</p>\n<p>Any thoughts on this?</p>",
      "rawMarkdown": "Interesting discussion.\n\nI'd like to share my two thoughts about how to frame the problem:\n\n1. Multiclass classification: each time step belong to one of these 3 classes: onset, awake, and not both. The challenge for this scheme is that the dataset will be heavily imbalanced to \"not both\" class as the majority.\n\n2. Binary classification: for each timestep starting from an \"onset\" to the next closest \"awake\", this timestep is classified as \"onset\". Other than that, it will be \"awake\".\n\nThe 2nd strategy will result in imbalanced dataset as well but much more balanced than the 1st one.\n\nI have an experience of solving similar event detection task, specifically in earthquake phase picking, and it results that the 2nd strategy is much more easier for the model to solve rather than the 1st.\n\nAny thoughts on this?",
      "votes": 2,
      "replies": [
        {
          "id": 2431849,
          "postDate": "2023-09-10T13:10:27.463Z",
          "content": "<p>So, example to clarify. Consider a series like this:</p>\n<pre><code>,\n,onset\n,awake\n,onset\n,awake\n</code></pre>\n<p>The 1st scheme will result in: timestep 4 and 20 as onset, 7 and 25 as awake, and timestep 1-3, 5-6, 8-19, 21-24, and &gt;26 as \"not both\".</p>\n<p>The 2nd scheme will result in: timestep 4-6 and 20-24 as onset, and the remaining as awake.</p>",
          "rawMarkdown": "So, example to clarify. Consider a series like this:\n\n```\nstep,event\n4,onset\n7,awake\n20,onset\n25,awake\n```\n\nThe 1st scheme will result in: timestep 4 and 20 as onset, 7 and 25 as awake, and timestep 1-3, 5-6, 8-19, 21-24, and >26 as \"not both\".\n\nThe 2nd scheme will result in: timestep 4-6 and 20-24 as onset, and the remaining as awake.",
          "votes": 3
        }
      ]
    },
    {
      "id": 2431285,
      "postDate": "2023-09-10T02:15:31.817Z",
      "content": "<p>Who is this ChatGPT?</p>",
      "rawMarkdown": "Who is this ChatGPT?",
      "votes": 2,
      "replies": [
        {
          "id": 2431492,
          "postDate": "2023-09-10T06:41:29.003Z",
          "rawMarkdown": "",
          "isDeleted": true
        },
        {
          "id": 2431509,
          "postDate": "2023-09-10T07:00:56.960Z",
          "content": "<p><a href=\"https://www.kaggle.com/bkowshik\" target=\"_blank\">@bkowshik</a> I think this is a reasonable reaction from Kaggler.</p>",
          "rawMarkdown": "@bkowshik I think this is a reasonable reaction from Kaggler.",
          "votes": 1
        },
        {
          "id": 2431751,
          "postDate": "2023-09-10T11:26:14.837Z",
          "content": "<p>Sure <a href=\"https://www.kaggle.com/mitsuyasuhoshino\" target=\"_blank\">@mitsuyasuhoshino</a> </p>",
          "rawMarkdown": "Sure @mitsuyasuhoshino ",
          "votes": 2,
          "isDeleted": true
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2431843,
      "author_name": "Rimba Erlangga",
      "author_url": "",
      "post_date": "2023-09-10T13:05:29.970000",
      "content": "<p>Interesting discussion.</p>\n<p>I'd like to share my two thoughts about how to frame the problem:</p>\n<ol>\n<li><p>Multiclass classification: each time step belong to one of these 3 classes: onset, awake, and not both. The challenge for this scheme is that the dataset will be heavily imbalanced to \"not both\" class as the majority.</p></li>\n<li><p>Binary classification: for each timestep starting from an \"onset\" to the next closest \"awake\", this timestep is classified as \"onset\". Other than that, it will be \"awake\".</p></li>\n</ol>\n<p>The 2nd strategy will result in imbalanced dataset as well but much more balanced than the 1st one.</p>\n<p>I have an experience of solving similar event detection task, specifically in earthquake phase picking, and it results that the 2nd strategy is much more easier for the model to solve rather than the 1st.</p>\n<p>Any thoughts on this?</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2431849,
          "author_name": "Rimba Erlangga",
          "author_url": "",
          "post_date": "2023-09-10T13:10:27.463000",
          "content": "<p>So, example to clarify. Consider a series like this:</p>\n<pre><code>,\n,onset\n,awake\n,onset\n,awake\n</code></pre>\n<p>The 1st scheme will result in: timestep 4 and 20 as onset, 7 and 25 as awake, and timestep 1-3, 5-6, 8-19, 21-24, and &gt;26 as \"not both\".</p>\n<p>The 2nd scheme will result in: timestep 4-6 and 20-24 as onset, and the remaining as awake.</p>",
          "votes": 3,
          "replies": []
        }
      ]
    },
    {
      "id": 2431285,
      "author_name": "Tolga",
      "author_url": "",
      "post_date": "2023-09-10T02:15:31.817000",
      "content": "<p>Who is this ChatGPT?</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2431492,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-09-10T06:41:29.003000",
          "content": "",
          "votes": 0,
          "replies": []
        },
        {
          "id": 2431509,
          "author_name": "mh",
          "author_url": "",
          "post_date": "2023-09-10T07:00:56.960000",
          "content": "<p><a href=\"https://www.kaggle.com/bkowshik\" target=\"_blank\">@bkowshik</a> I think this is a reasonable reaction from Kaggler.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 2431751,
          "author_name": "Bhargav Kowshik",
          "author_url": "",
          "post_date": "2023-09-10T11:26:14.837000",
          "content": "<p>Sure <a href=\"https://www.kaggle.com/mitsuyasuhoshino\" target=\"_blank\">@mitsuyasuhoshino</a> </p>",
          "votes": 2,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2429707": "Greetings! \n\nI have a silly question. Do we have to solve binary classification problem or multilabel classification problem? Why am I asking such a strange  thing? I'll try to explain.\n\n\nIf it is binary classification problem we most clear way to define initial data is to add \"sleep\" or \"awake\" column to  train_series.parquet with 0/1 or True/False value. And that is all.\n\n\nBut we have train_events.csv file which contains 2 sorts of events - \"sleep onset\" and \"awakening\". It seems to be data for multilabel classification problem with a very very big class disbalance.\n\n\nWhat sort of problem do we have?\n\n**Shall we predict the state of person (sleeping or keeping awake)?** In other words, we need to predict the probability of sleeping / wakefulness, and P(sleeping ) + P(wakefulness) == 1?\n\n**OR** shall we predict the probability of sleep onset even and probability of awakening event (and both of these events are really rare and mutually exclusive)?\nIn other words, **do we have to find the moments of sleep onset even and awakening?**\n\nSample of submission file in overview doesn't make this clear:\n>row_id,series_id,step,event,score\n0,038441c925bb,100,onset,0.0\n1,038441c925bb,105,wakeup,0.0\n2,03d92c9f6f8a,80,onset,0.5\n3,03d92c9f6f8a,110,wakeup,0.5\n4,0402a003dae9,90,onset,1.0\n5,0402a003dae9,120,wakeup,1.0\n\nBut sample submission looks more like multilabel classification for me.",
    "2431843": "Interesting discussion.\n\nI'd like to share my two thoughts about how to frame the problem:\n\n1. Multiclass classification: each time step belong to one of these 3 classes: onset, awake, and not both. The challenge for this scheme is that the dataset will be heavily imbalanced to \"not both\" class as the majority.\n\n2. Binary classification: for each timestep starting from an \"onset\" to the next closest \"awake\", this timestep is classified as \"onset\". Other than that, it will be \"awake\".\n\nThe 2nd strategy will result in imbalanced dataset as well but much more balanced than the 1st one.\n\nI have an experience of solving similar event detection task, specifically in earthquake phase picking, and it results that the 2nd strategy is much more easier for the model to solve rather than the 1st.\n\nAny thoughts on this?",
    "2431285": "Who is this ChatGPT?"
  }
}