{
  "id": 437920,
  "title": "What defines a \"night\"?",
  "url": "/competitions/child-mind-institute-detect-sleep-states/discussion/437920",
  "author_name": "jagofc",
  "post_date": "2023-09-08T17:25:18.983000",
  "votes": 9,
  "comment_count": 9,
  "views": 0,
  "content": "<p>The <a href=\"https://www.kaggle.com/competitions/child-mind-institute-detect-sleep-states/data\" target=\"_blank\">dataset description</a> says it defines concrete rules for the ground-truth labelling:</p>\n<ul>\n<li>The longest sleep window during the <strong>night</strong> is the only one which is recorded.</li>\n<li>no more than one window should be assigned per <strong>night</strong>.</li>\n<li>…</li>\n</ul>\n<p>But I cannot see a definition for a \"night\" (e.g. a time window 20:00 - 06:00).</p>\n<p>Has anyone spotted a concrete definition for this, or was it left up to the raters to decide what <em>they</em> thought constituted a night? </p>",
  "messages": [
    {
      "id": 2429625,
      "postDate": "2023-09-08T17:25:18.983Z",
      "content": "<p>The <a href=\"https://www.kaggle.com/competitions/child-mind-institute-detect-sleep-states/data\" target=\"_blank\">dataset description</a> says it defines concrete rules for the ground-truth labelling:</p>\n<ul>\n<li>The longest sleep window during the <strong>night</strong> is the only one which is recorded.</li>\n<li>no more than one window should be assigned per <strong>night</strong>.</li>\n<li>…</li>\n</ul>\n<p>But I cannot see a definition for a \"night\" (e.g. a time window 20:00 - 06:00).</p>\n<p>Has anyone spotted a concrete definition for this, or was it left up to the raters to decide what <em>they</em> thought constituted a night? </p>",
      "rawMarkdown": "The [dataset description](https://www.kaggle.com/competitions/child-mind-institute-detect-sleep-states/data) says it defines concrete rules for the ground-truth labelling:\n\n- The longest sleep window during the **night** is the only one which is recorded.\n- no more than one window should be assigned per **night**.\n- ...\n\nBut I cannot see a definition for a \"night\" (e.g. a time window 20:00 - 06:00).\n\nHas anyone spotted a concrete definition for this, or was it left up to the raters to decide what *they* thought constituted a night? \n\n\n\n",
      "votes": 8
    },
    {
      "id": 2432260,
      "postDate": "2023-09-10T17:37:27.497Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/jagofc\" target=\"_blank\">@jagofc</a> </p>\n<p>We have labeled data only for train events, so for test set it is upto us to define night,<br>\nI think we should go with definition of night as given in train_events.csv file description.<br>\nSo extended nap is to be recorded as night.<br>\nI understand the ambiguity you are refering to but i guess they only want us to predict approx as many event pairs as there are 24 hr periods in test set. That is the only takeaway.</p>\n<p><a href=\"https://www.kaggle.com/maggiemd\" target=\"_blank\">@maggiemd</a> can you elaborate more on \"definition of night\" as asked by <a href=\"https://www.kaggle.com/jagofc\" target=\"_blank\">@jagofc</a> ?</p>",
      "rawMarkdown": "Hi @jagofc \n\nWe have labeled data only for train events, so for test set it is upto us to define night,\nI think we should go with definition of night as given in train_events.csv file description.\nSo extended nap is to be recorded as night.\nI understand the ambiguity you are refering to but i guess they only want us to predict approx as many event pairs as there are 24 hr periods in test set. That is the only takeaway.\n\n@maggiemd can you elaborate more on \"definition of night\" as asked by @jagofc ?",
      "votes": 1
    },
    {
      "id": 2430727,
      "postDate": "2023-09-09T14:34:12.667Z",
      "content": "<p>I don't really know the definition of \"night\". Although it only appears in the training data, <a href=\"https://www.kaggle.com/code/mitsuyasuhoshino/cmi-detectsleepstates-eda-visualization\" target=\"_blank\">my EDA</a> divides the \"night\" in an arbitrary manner (namely divide time in the middle between events). Since there is no \"night\" column in the test data, we need to predict one set of \"events\" for one \"series_id\" during inference (however we cannot rule out the possibility that multiple \"nights\" are connected).</p>",
      "rawMarkdown": "I don't really know the definition of \"night\". Although it only appears in the training data, [my EDA](https://www.kaggle.com/code/mitsuyasuhoshino/cmi-detectsleepstates-eda-visualization) divides the \"night\" in an arbitrary manner (namely divide time in the middle between events). Since there is no \"night\" column in the test data, we need to predict one set of \"events\" for one \"series_id\" during inference (however we cannot rule out the possibility that multiple \"nights\" are connected).",
      "votes": 1,
      "replies": [
        {
          "id": 2430744,
          "postDate": "2023-09-09T14:49:22.857Z",
          "content": "<p>Thanks for your comment <a href=\"https://www.kaggle.com/mitsuyasuhoshino\" target=\"_blank\">@mitsuyasuhoshino</a> :) - I roughly understand the motivation behind the labelling, but there is some lack of precision there at the moment, which is what I'm hoping to get clarified.</p>\n<p>E.g. if the child has an extended nap for say four hours 12:00-16:00, and then sleeps for just three hours 23:00 - 02:00 subsequently, does that mean that the onset would be 12:00 and wakeup at 16:00 in this circumstance?</p>\n<p>If I were a labeller and I were given the instructions above, then I'd need clarification from the competition team about what a night is. After all, the labels form the ground truth that our test predictions are assessed against.</p>",
          "rawMarkdown": "Thanks for your comment @mitsuyasuhoshino :) - I roughly understand the motivation behind the labelling, but there is some lack of precision there at the moment, which is what I'm hoping to get clarified.\n\nE.g. if the child has an extended nap for say four hours 12:00-16:00, and then sleeps for just three hours 23:00 - 02:00 subsequently, does that mean that the onset would be 12:00 and wakeup at 16:00 in this circumstance?\n\nIf I were a labeller and I were given the instructions above, then I'd need clarification from the competition team about what a night is. After all, the labels form the ground truth that our test predictions are assessed against.",
          "votes": 1,
          "replies": [
            {
              "id": 2430760,
              "postDate": "2023-09-09T15:05:50.460Z",
              "content": "<p>I understand the intent of your question <a href=\"https://www.kaggle.com/jagofc\" target=\"_blank\">@jagofc</a>. However, \"night\" as a feature is the sleep time count information for \"series_id\", so I don't think you need to worry about the time period defined as sleep. I haven't seen it yet, but line 14510 of train_events may include a nap…</p>",
              "rawMarkdown": "I understand the intent of your question @jagofc. However, \"night\" as a feature is the sleep time count information for \"series_id\", so I don't think you need to worry about the time period defined as sleep. I haven't seen it yet, but line 14510 of train_events may include a nap..."
            },
            {
              "id": 2430783,
              "postDate": "2023-09-09T15:15:52.083Z",
              "content": "<p>I think we might be talking about different things <a href=\"https://www.kaggle.com/mitsuyasuhoshino\" target=\"_blank\">@mitsuyasuhoshino</a> - I'm not referring to night as a feature, or as it occurs in <code>train_events.csv</code>. I'm referring to the original labelling instructions and how it was conducted in the first place. They mention a reference to night (as highlighted in bold in the original question), but there is no associated definition.</p>",
              "rawMarkdown": "I think we might be talking about different things @mitsuyasuhoshino - I'm not referring to night as a feature, or as it occurs in `train_events.csv`. I'm referring to the original labelling instructions and how it was conducted in the first place. They mention a reference to night (as highlighted in bold in the original question), but there is no associated definition."
            },
            {
              "id": 2430821,
              "postDate": "2023-09-09T15:57:45.727Z",
              "content": "<p>Understood <a href=\"https://www.kaggle.com/jagofc\" target=\"_blank\">@jagofc</a>. That's all I've answered.</p>",
              "rawMarkdown": "Understood @jagofc. That's all I've answered."
            }
          ]
        }
      ]
    },
    {
      "id": 2503078,
      "postDate": "2023-10-28T18:12:46.030Z",
      "content": "<p>Looked at the relationship between <code>night</code> and <code>timestamp</code> from a whether there it's <code>NULL</code> or not.</p>\n<p>First looked at what percentage of series IDs have event annotations for the different nights. Roughly, there are 3 groups here:</p>\n<ol>\n<li>These series have event annotations upto <code>23 days</code>.</li>\n<li>These series have event annotations upto <code>43 days</code>.</li>\n<li>Small set of series that have event annotations for <code>44 days</code> and beyond.</li>\n</ol>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2Fe04f80f8cfa4f7c159e7ffe2ad894e12%2FUntitled%20(3).png?generation=1698516497196432&amp;alt=media\" alt=\"\"></p>\n<p>Next, calculated the number of events annotated per night split into <code>NULL</code> and <code>Not NULL</code>. When the value of <code>step</code> is <code>NULL</code>, the column <code>step_is_null</code> is set to <code>True</code> and <code>False</code> otherwise.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2F6a7ce371e12b7f300461a19e423d1ef6%2FUntitled%20(1).png?generation=1698516592662762&amp;alt=media\" alt=\"\"></p>\n<p>Finally, converted the count to percentage of events annotated per night split into <code>NULL</code> and <code>Not NULL</code>. Clearly, as the number of days increases, percentage of event annotations with <code>NULL</code> value in step increases too.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2F528815e6cff457497d6d6a23311c0469%2FUntitled%20(2).png?generation=1698516716413690&amp;alt=media\" alt=\"\"></p>",
      "rawMarkdown": "Looked at the relationship between `night` and `timestamp` from a whether there it's `NULL` or not.\n\nFirst looked at what percentage of series IDs have event annotations for the different nights. Roughly, there are 3 groups here:\n\n1. These series have event annotations upto `23 days`.\n2. These series have event annotations upto `43 days`.\n3. Small set of series that have event annotations for `44 days` and beyond.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2Fe04f80f8cfa4f7c159e7ffe2ad894e12%2FUntitled%20(3).png?generation=1698516497196432&alt=media)\n\nNext, calculated the number of events annotated per night split into `NULL` and `Not NULL`. When the value of `step` is `NULL`, the column `step_is_null` is set to `True` and `False` otherwise.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2F6a7ce371e12b7f300461a19e423d1ef6%2FUntitled%20(1).png?generation=1698516592662762&alt=media)\n\nFinally, converted the count to percentage of events annotated per night split into `NULL` and `Not NULL`. Clearly, as the number of days increases, percentage of event annotations with `NULL` value in step increases too.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2F528815e6cff457497d6d6a23311c0469%2FUntitled%20(2).png?generation=1698516716413690&alt=media)\n\n"
    },
    {
      "id": 2431469,
      "postDate": "2023-09-10T06:30:27.537Z",
      "content": "<p>Only 3 out of <code>14507 samples</code> had multiple events recorded per night. Which means, along the expectation, a combination of <code>[series_id, night, event]</code> has just one row in the events dataset. The 3 incorrect samples are below:</p>\n<pre><code>    ,night ,event ,samples\n ,    ,onset ,      \n ,     ,onset ,      \n ,    ,onset ,      \n</code></pre>\n<p>One of the incorrect samples is below. There is a duplicate <code>onset</code> event with the difference being in the step and the timezone.</p>\n<pre><code>    ,night ,event  ,step     ,timestamp                 ,hour\n ,    ,onset  ,. ,-- ::-: , .\n ,    ,onset  ,. ,-- ::-: , .\n ,    ,wakeup ,. ,-- ::-: , .\n</code></pre>",
      "rawMarkdown": "Only 3 out of `14507 samples` had multiple events recorded per night. Which means, along the expectation, a combination of `[series_id, night, event]` has just one row in the events dataset. The 3 incorrect samples are below:\n\n```\nseries_id    ,night ,event ,samples\nc6788e579967 ,   20 ,onset ,      2\n655f19eabf1e ,    3 ,onset ,      2\n8a306e0890c0 ,   11 ,onset ,      2\n```\n\nOne of the incorrect samples is below. There is a duplicate `onset` event with the difference being in the step and the timezone.\n```\nseries_id    ,night ,event  ,step     ,timestamp                 ,hour\n8a306e0890c0 ,   11 ,onset  ,178464.0 ,2017-11-12 01:37:00-04:00 , 1.0\n8a306e0890c0 ,   11 ,onset  ,179184.0 ,2017-11-12 01:37:00-05:00 , 1.0\n8a306e0890c0 ,   11 ,wakeup ,184536.0 ,2017-11-12 09:03:00-05:00 , 9.0\n```",
      "votes": 2,
      "isDeleted": true,
      "replies": [
        {
          "id": 2436768,
          "postDate": "2023-09-13T18:44:27.350Z",
          "content": "<p>Yes.  And there is a 4th case where two wakeups do not have an onset between them. Below is the code I'm using to correct these in the events dataframe. \"Buyer beware\": I may not have picked the best of each onset pair, nor patched in a best step/time for the missing onset.  😉</p>\n<pre><code>\ntrain_events = pd.read_csv(train_events_file)\n(, len(train_events.series_id.unique()),\n      )\n\n\n\n\ntrain_events = train_events.drop([5362],=0)\n\n\ntrain_events = train_events.drop([7358],=0)\n\n\n\n\ntrain_events.loc[10131.5] = [, 20, , 339000, \n                            ]\n\ntrain_events = train_events.sort_index().reset_index(=)\n\n\ntrain_events = train_events.drop([10348],=0)\n\ntrain_events = train_events.sort_index().reset_index(=)\n\ntrain_events\n</code></pre>",
          "rawMarkdown": "Yes.  And there is a 4th case where two wakeups do not have an onset between them. Below is the code I'm using to correct these in the events dataframe. \"Buyer beware\": I may not have picked the best of each onset pair, nor patched in a best step/time for the missing onset.  😉\n\n```\n# Read the events file\ntrain_events = pd.read_csv(train_events_file)\nprint(\"\\nContains\", len(train_events.series_id.unique()),\n      \"unique series_id values.\\n\")\n#\n# *** Modify some Events ***\n#\n# --- 655f19eabf1e : Remove the first night 3 onset:\ntrain_events = train_events.drop([5362],axis=0)\n#\n# --- 8a306e0890c0 : Remove the extra night 11 onset\ntrain_events = train_events.drop([7358],axis=0)\n#\n# --- c3072a759efb : Insert the missing onset for night 20, at 338000\n# Want it at index 10132\n# Add 1 to current 10132 and ones above, put it where desired using float index:\ntrain_events.loc[10131.5] = ['c3072a759efb', 20, 'onset', 339000, \n                            '2018-03-18T23:00:00-0500']\n# Re-do integer indices\ntrain_events = train_events.sort_index().reset_index(drop=True)\n#\n# --- c6788e579967 : Remove the extra onset for night 20\ntrain_events = train_events.drop([10348],axis=0)\n# Re-do integer indices\ntrain_events = train_events.sort_index().reset_index(drop=True)\n#\ntrain_events\n```",
          "votes": 1
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 2432260,
      "author_name": "Rohit Chaudhari",
      "author_url": "",
      "post_date": "2023-09-10T17:37:27.497000",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/jagofc\" target=\"_blank\">@jagofc</a> </p>\n<p>We have labeled data only for train events, so for test set it is upto us to define night,<br>\nI think we should go with definition of night as given in train_events.csv file description.<br>\nSo extended nap is to be recorded as night.<br>\nI understand the ambiguity you are refering to but i guess they only want us to predict approx as many event pairs as there are 24 hr periods in test set. That is the only takeaway.</p>\n<p><a href=\"https://www.kaggle.com/maggiemd\" target=\"_blank\">@maggiemd</a> can you elaborate more on \"definition of night\" as asked by <a href=\"https://www.kaggle.com/jagofc\" target=\"_blank\">@jagofc</a> ?</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 2430727,
      "author_name": "mh",
      "author_url": "",
      "post_date": "2023-09-09T14:34:12.667000",
      "content": "<p>I don't really know the definition of \"night\". Although it only appears in the training data, <a href=\"https://www.kaggle.com/code/mitsuyasuhoshino/cmi-detectsleepstates-eda-visualization\" target=\"_blank\">my EDA</a> divides the \"night\" in an arbitrary manner (namely divide time in the middle between events). Since there is no \"night\" column in the test data, we need to predict one set of \"events\" for one \"series_id\" during inference (however we cannot rule out the possibility that multiple \"nights\" are connected).</p>",
      "votes": 1,
      "replies": [
        {
          "id": 2430744,
          "author_name": "jagofc",
          "author_url": "",
          "post_date": "2023-09-09T14:49:22.857000",
          "content": "<p>Thanks for your comment <a href=\"https://www.kaggle.com/mitsuyasuhoshino\" target=\"_blank\">@mitsuyasuhoshino</a> :) - I roughly understand the motivation behind the labelling, but there is some lack of precision there at the moment, which is what I'm hoping to get clarified.</p>\n<p>E.g. if the child has an extended nap for say four hours 12:00-16:00, and then sleeps for just three hours 23:00 - 02:00 subsequently, does that mean that the onset would be 12:00 and wakeup at 16:00 in this circumstance?</p>\n<p>If I were a labeller and I were given the instructions above, then I'd need clarification from the competition team about what a night is. After all, the labels form the ground truth that our test predictions are assessed against.</p>",
          "votes": 1,
          "replies": [
            {
              "id": 2430760,
              "author_name": "mh",
              "author_url": "",
              "post_date": "2023-09-09T15:05:50.460000",
              "content": "<p>I understand the intent of your question <a href=\"https://www.kaggle.com/jagofc\" target=\"_blank\">@jagofc</a>. However, \"night\" as a feature is the sleep time count information for \"series_id\", so I don't think you need to worry about the time period defined as sleep. I haven't seen it yet, but line 14510 of train_events may include a nap…</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2430783,
              "author_name": "jagofc",
              "author_url": "",
              "post_date": "2023-09-09T15:15:52.083000",
              "content": "<p>I think we might be talking about different things <a href=\"https://www.kaggle.com/mitsuyasuhoshino\" target=\"_blank\">@mitsuyasuhoshino</a> - I'm not referring to night as a feature, or as it occurs in <code>train_events.csv</code>. I'm referring to the original labelling instructions and how it was conducted in the first place. They mention a reference to night (as highlighted in bold in the original question), but there is no associated definition.</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 2430821,
              "author_name": "mh",
              "author_url": "",
              "post_date": "2023-09-09T15:57:45.727000",
              "content": "<p>Understood <a href=\"https://www.kaggle.com/jagofc\" target=\"_blank\">@jagofc</a>. That's all I've answered.</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2503078,
      "author_name": "Bhargav Kowshik",
      "author_url": "",
      "post_date": "2023-10-28T18:12:46.030000",
      "content": "<p>Looked at the relationship between <code>night</code> and <code>timestamp</code> from a whether there it's <code>NULL</code> or not.</p>\n<p>First looked at what percentage of series IDs have event annotations for the different nights. Roughly, there are 3 groups here:</p>\n<ol>\n<li>These series have event annotations upto <code>23 days</code>.</li>\n<li>These series have event annotations upto <code>43 days</code>.</li>\n<li>Small set of series that have event annotations for <code>44 days</code> and beyond.</li>\n</ol>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2Fe04f80f8cfa4f7c159e7ffe2ad894e12%2FUntitled%20(3).png?generation=1698516497196432&amp;alt=media\" alt=\"\"></p>\n<p>Next, calculated the number of events annotated per night split into <code>NULL</code> and <code>Not NULL</code>. When the value of <code>step</code> is <code>NULL</code>, the column <code>step_is_null</code> is set to <code>True</code> and <code>False</code> otherwise.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2F6a7ce371e12b7f300461a19e423d1ef6%2FUntitled%20(1).png?generation=1698516592662762&amp;alt=media\" alt=\"\"></p>\n<p>Finally, converted the count to percentage of events annotated per night split into <code>NULL</code> and <code>Not NULL</code>. Clearly, as the number of days increases, percentage of event annotations with <code>NULL</code> value in step increases too.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2F528815e6cff457497d6d6a23311c0469%2FUntitled%20(2).png?generation=1698516716413690&amp;alt=media\" alt=\"\"></p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 2431469,
      "author_name": "Bhargav Kowshik",
      "author_url": "",
      "post_date": "2023-09-10T06:30:27.537000",
      "content": "<p>Only 3 out of <code>14507 samples</code> had multiple events recorded per night. Which means, along the expectation, a combination of <code>[series_id, night, event]</code> has just one row in the events dataset. The 3 incorrect samples are below:</p>\n<pre><code>    ,night ,event ,samples\n ,    ,onset ,      \n ,     ,onset ,      \n ,    ,onset ,      \n</code></pre>\n<p>One of the incorrect samples is below. There is a duplicate <code>onset</code> event with the difference being in the step and the timezone.</p>\n<pre><code>    ,night ,event  ,step     ,timestamp                 ,hour\n ,    ,onset  ,. ,-- ::-: , .\n ,    ,onset  ,. ,-- ::-: , .\n ,    ,wakeup ,. ,-- ::-: , .\n</code></pre>",
      "votes": 2,
      "replies": [
        {
          "id": 2436768,
          "author_name": "Daniel Dewey",
          "author_url": "",
          "post_date": "2023-09-13T18:44:27.350000",
          "content": "<p>Yes.  And there is a 4th case where two wakeups do not have an onset between them. Below is the code I'm using to correct these in the events dataframe. \"Buyer beware\": I may not have picked the best of each onset pair, nor patched in a best step/time for the missing onset.  😉</p>\n<pre><code>\ntrain_events = pd.read_csv(train_events_file)\n(, len(train_events.series_id.unique()),\n      )\n\n\n\n\ntrain_events = train_events.drop([5362],=0)\n\n\ntrain_events = train_events.drop([7358],=0)\n\n\n\n\ntrain_events.loc[10131.5] = [, 20, , 339000, \n                            ]\n\ntrain_events = train_events.sort_index().reset_index(=)\n\n\ntrain_events = train_events.drop([10348],=0)\n\ntrain_events = train_events.sort_index().reset_index(=)\n\ntrain_events\n</code></pre>",
          "votes": 1,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2429625": "The [dataset description](https://www.kaggle.com/competitions/child-mind-institute-detect-sleep-states/data) says it defines concrete rules for the ground-truth labelling:\n\n- The longest sleep window during the **night** is the only one which is recorded.\n- no more than one window should be assigned per **night**.\n- ...\n\nBut I cannot see a definition for a \"night\" (e.g. a time window 20:00 - 06:00).\n\nHas anyone spotted a concrete definition for this, or was it left up to the raters to decide what *they* thought constituted a night? \n\n\n\n",
    "2432260": "Hi @jagofc \n\nWe have labeled data only for train events, so for test set it is upto us to define night,\nI think we should go with definition of night as given in train_events.csv file description.\nSo extended nap is to be recorded as night.\nI understand the ambiguity you are refering to but i guess they only want us to predict approx as many event pairs as there are 24 hr periods in test set. That is the only takeaway.\n\n@maggiemd can you elaborate more on \"definition of night\" as asked by @jagofc ?",
    "2430727": "I don't really know the definition of \"night\". Although it only appears in the training data, [my EDA](https://www.kaggle.com/code/mitsuyasuhoshino/cmi-detectsleepstates-eda-visualization) divides the \"night\" in an arbitrary manner (namely divide time in the middle between events). Since there is no \"night\" column in the test data, we need to predict one set of \"events\" for one \"series_id\" during inference (however we cannot rule out the possibility that multiple \"nights\" are connected).",
    "2503078": "Looked at the relationship between `night` and `timestamp` from a whether there it's `NULL` or not.\n\nFirst looked at what percentage of series IDs have event annotations for the different nights. Roughly, there are 3 groups here:\n\n1. These series have event annotations upto `23 days`.\n2. These series have event annotations upto `43 days`.\n3. Small set of series that have event annotations for `44 days` and beyond.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2Fe04f80f8cfa4f7c159e7ffe2ad894e12%2FUntitled%20(3).png?generation=1698516497196432&alt=media)\n\nNext, calculated the number of events annotated per night split into `NULL` and `Not NULL`. When the value of `step` is `NULL`, the column `step_is_null` is set to `True` and `False` otherwise.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2F6a7ce371e12b7f300461a19e423d1ef6%2FUntitled%20(1).png?generation=1698516592662762&alt=media)\n\nFinally, converted the count to percentage of events annotated per night split into `NULL` and `Not NULL`. Clearly, as the number of days increases, percentage of event annotations with `NULL` value in step increases too.\n\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F5210536%2F528815e6cff457497d6d6a23311c0469%2FUntitled%20(2).png?generation=1698516716413690&alt=media)\n\n",
    "2431469": "Only 3 out of `14507 samples` had multiple events recorded per night. Which means, along the expectation, a combination of `[series_id, night, event]` has just one row in the events dataset. The 3 incorrect samples are below:\n\n```\nseries_id    ,night ,event ,samples\nc6788e579967 ,   20 ,onset ,      2\n655f19eabf1e ,    3 ,onset ,      2\n8a306e0890c0 ,   11 ,onset ,      2\n```\n\nOne of the incorrect samples is below. There is a duplicate `onset` event with the difference being in the step and the timezone.\n```\nseries_id    ,night ,event  ,step     ,timestamp                 ,hour\n8a306e0890c0 ,   11 ,onset  ,178464.0 ,2017-11-12 01:37:00-04:00 , 1.0\n8a306e0890c0 ,   11 ,onset  ,179184.0 ,2017-11-12 01:37:00-05:00 , 1.0\n8a306e0890c0 ,   11 ,wakeup ,184536.0 ,2017-11-12 09:03:00-05:00 , 9.0\n```"
  }
}