{
  "id": 441058,
  "title": "What is this - \"signal_awake = dict(zip(range(1440), np.sin(np.linspace(0, np.pi, 1440) + 0.208 * np.pi) ** 24))\" ??",
  "url": "/competitions/child-mind-institute-detect-sleep-states/discussion/441058",
  "author_name": "Abhranta Panigrahi",
  "post_date": "2023-09-17T11:37:15.885000",
  "votes": 5,
  "comment_count": 8,
  "views": 0,
  "content": "<p>Every top scoring public notebook seems to this feature and Ican't understand what this means? Can anyone please exaplain??</p>\n<p>\"\"\"<br>\nsignal_awake = dict(zip(range(1440), np.sin(np.linspace(0, np.pi, 1440) + 0.208 * np.pi) ** 24))<br>\nsignal_onset = dict(zip(range(1440), np.sin(np.linspace(0, np.pi, 1440) + 0.555 * np.pi) ** 24))</p>\n<p>df['signal_onset'] = (df.timestamp.dt.hour * 60 + df.timestamp.dt.minute).map(signal_onset).astype(np.float32)<br>\ndf['signal_awake'] = (df.timestamp.dt.hour * 60 + df.timestamp.dt.minute).map(signal_awake).astype(np.float32)</p>\n<p>\"\"\"</p>",
  "messages": [
    {
      "id": 2442901,
      "postDate": "2023-09-17T11:37:15.887Z",
      "content": "<p>Every top scoring public notebook seems to this feature and Ican't understand what this means? Can anyone please exaplain??</p>\n<p>\"\"\"<br>\nsignal_awake = dict(zip(range(1440), np.sin(np.linspace(0, np.pi, 1440) + 0.208 * np.pi) ** 24))<br>\nsignal_onset = dict(zip(range(1440), np.sin(np.linspace(0, np.pi, 1440) + 0.555 * np.pi) ** 24))</p>\n<p>df['signal_onset'] = (df.timestamp.dt.hour * 60 + df.timestamp.dt.minute).map(signal_onset).astype(np.float32)<br>\ndf['signal_awake'] = (df.timestamp.dt.hour * 60 + df.timestamp.dt.minute).map(signal_awake).astype(np.float32)</p>\n<p>\"\"\"</p>",
      "rawMarkdown": "Every top scoring public notebook seems to this feature and Ican't understand what this means? Can anyone please exaplain??\n\n\"\"\"\nsignal_awake = dict(zip(range(1440), np.sin(np.linspace(0, np.pi, 1440) + 0.208 * np.pi) ** 24))\nsignal_onset = dict(zip(range(1440), np.sin(np.linspace(0, np.pi, 1440) + 0.555 * np.pi) ** 24))\n\ndf['signal_onset'] = (df.timestamp.dt.hour * 60 + df.timestamp.dt.minute).map(signal_onset).astype(np.float32)\ndf['signal_awake'] = (df.timestamp.dt.hour * 60 + df.timestamp.dt.minute).map(signal_awake).astype(np.float32)\n\n\"\"\"",
      "votes": 5
    },
    {
      "id": 2443305,
      "postDate": "2023-09-17T16:33:52.030Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/abhranta\" target=\"_blank\">@abhranta</a> it is actually to involve periodic signal instead of raw hour.</p>\n<p>You can find more explanation on the notebook I made <a href=\"https://www.kaggle.com/code/rimbax/detection-converting-hour-into-periodic-signal\" target=\"_blank\">here</a>. Hope it answers your question</p>",
      "rawMarkdown": "Hi @abhranta it is actually to involve periodic signal instead of raw hour.\n\nYou can find more explanation on the notebook I made [here](https://www.kaggle.com/code/rimbax/detection-converting-hour-into-periodic-signal). Hope it answers your question",
      "votes": 3,
      "replies": [
        {
          "id": 2444592,
          "postDate": "2023-09-18T11:03:14.290Z",
          "content": "<p>oooo thats a smart move. </p>",
          "rawMarkdown": "oooo thats a smart move. ",
          "votes": 2
        }
      ]
    },
    {
      "id": 2443142,
      "postDate": "2023-09-17T14:47:23.580Z",
      "content": "<p>By the way, I am also curious what does Lids mean:</p>\n<p>df['lids'] = np.maximum(0., df['enmo'] - 0.02)<br>\n    df['lids'] = df['lids'].rolling(120, center=True, min_periods=1).agg('sum')<br>\n    df['lids'] = 100 / (df['lids'] + 1)<br>\n    df['lids'] = df['lids'].rolling(360, center=True, min_periods=1).agg('mean').astype(np.float32)</p>\n<p>Thanks </p>",
      "rawMarkdown": "By the way, I am also curious what does Lids mean:\n\ndf['lids'] = np.maximum(0., df['enmo'] - 0.02)\n    df['lids'] = df['lids'].rolling(120, center=True, min_periods=1).agg('sum')\n    df['lids'] = 100 / (df['lids'] + 1)\n    df['lids'] = df['lids'].rolling(360, center=True, min_periods=1).agg('mean').astype(np.float32)\n\nThanks ",
      "votes": 1,
      "replies": [
        {
          "id": 2443311,
          "postDate": "2023-09-17T16:40:05.357Z",
          "content": "<p>LIDS is Locomotor Inactivity During Sleep. For further explanation, refer to <a href=\"https://www.nature.com/articles/s41598-020-79217-x.pdf\" target=\"_blank\">this</a> paper.</p>",
          "rawMarkdown": "LIDS is Locomotor Inactivity During Sleep. For further explanation, refer to [this](https://www.nature.com/articles/s41598-020-79217-x.pdf) paper.",
          "votes": 3,
          "replies": [
            {
              "id": 2454461,
              "postDate": "2023-09-24T19:59:35.610Z",
              "content": "<p>Sorry for replying a bit late, but thanks for guiding me to the paper. Super interesting read! and It is really surprising how related this paper is to this competition, as it both use enmo and anglez as training data. Thanks a lot!</p>",
              "rawMarkdown": "Sorry for replying a bit late, but thanks for guiding me to the paper. Super interesting read! and It is really surprising how related this paper is to this competition, as it both use enmo and anglez as training data. Thanks a lot!",
              "votes": 2
            }
          ]
        }
      ]
    },
    {
      "id": 2442911,
      "postDate": "2023-09-17T11:50:12.637Z",
      "content": "<p>Dear <a href=\"https://www.kaggle.com/abhranta\" target=\"_blank\">@abhranta</a> </p>\n<blockquote>\n  <p>\"<em>Every top scoring public notebook</em>\"</p>\n</blockquote>\n<p>Which notebooks? Do you have a link?</p>\n<p>All the best,<br>\ncarl</p>",
      "rawMarkdown": "Dear @abhranta \n\n> \"*Every top scoring public notebook*\"\n\nWhich notebooks? Do you have a link?\n\nAll the best,\ncarl",
      "votes": 2,
      "replies": [
        {
          "id": 2442913,
          "postDate": "2023-09-17T11:52:30.730Z",
          "content": "<p>Hi Carl , </p>\n<p><a href=\"https://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi\" target=\"_blank\">https://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi</a></p>",
          "rawMarkdown": "Hi Carl , \n\nhttps://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi",
          "votes": 2
        }
      ]
    },
    {
      "id": 2443746,
      "postDate": "2023-09-18T00:11:28.833Z",
      "rawMarkdown": "",
      "isDeleted": true
    }
  ],
  "comments": [
    {
      "id": 2443305,
      "author_name": "Rimba Erlangga",
      "author_url": "",
      "post_date": "2023-09-17T16:33:52.030000",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/abhranta\" target=\"_blank\">@abhranta</a> it is actually to involve periodic signal instead of raw hour.</p>\n<p>You can find more explanation on the notebook I made <a href=\"https://www.kaggle.com/code/rimbax/detection-converting-hour-into-periodic-signal\" target=\"_blank\">here</a>. Hope it answers your question</p>",
      "votes": 3,
      "replies": [
        {
          "id": 2444592,
          "author_name": "Abhranta Panigrahi",
          "author_url": "",
          "post_date": "2023-09-18T11:03:14.290000",
          "content": "<p>oooo thats a smart move. </p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 2443142,
      "author_name": "Yuchen20",
      "author_url": "",
      "post_date": "2023-09-17T14:47:23.580000",
      "content": "<p>By the way, I am also curious what does Lids mean:</p>\n<p>df['lids'] = np.maximum(0., df['enmo'] - 0.02)<br>\n    df['lids'] = df['lids'].rolling(120, center=True, min_periods=1).agg('sum')<br>\n    df['lids'] = 100 / (df['lids'] + 1)<br>\n    df['lids'] = df['lids'].rolling(360, center=True, min_periods=1).agg('mean').astype(np.float32)</p>\n<p>Thanks </p>",
      "votes": 1,
      "replies": [
        {
          "id": 2443311,
          "author_name": "Akhil Pathak",
          "author_url": "",
          "post_date": "2023-09-17T16:40:05.357000",
          "content": "<p>LIDS is Locomotor Inactivity During Sleep. For further explanation, refer to <a href=\"https://www.nature.com/articles/s41598-020-79217-x.pdf\" target=\"_blank\">this</a> paper.</p>",
          "votes": 3,
          "replies": [
            {
              "id": 2454461,
              "author_name": "Yuchen20",
              "author_url": "",
              "post_date": "2023-09-24T19:59:35.610000",
              "content": "<p>Sorry for replying a bit late, but thanks for guiding me to the paper. Super interesting read! and It is really surprising how related this paper is to this competition, as it both use enmo and anglez as training data. Thanks a lot!</p>",
              "votes": 2,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2442911,
      "author_name": "Carl McBride Ellis",
      "author_url": "",
      "post_date": "2023-09-17T11:50:12.637000",
      "content": "<p>Dear <a href=\"https://www.kaggle.com/abhranta\" target=\"_blank\">@abhranta</a> </p>\n<blockquote>\n  <p>\"<em>Every top scoring public notebook</em>\"</p>\n</blockquote>\n<p>Which notebooks? Do you have a link?</p>\n<p>All the best,<br>\ncarl</p>",
      "votes": 2,
      "replies": [
        {
          "id": 2442913,
          "author_name": "Abhranta Panigrahi",
          "author_url": "",
          "post_date": "2023-09-17T11:52:30.730000",
          "content": "<p>Hi Carl , </p>\n<p><a href=\"https://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi\" target=\"_blank\">https://www.kaggle.com/code/renatoreggiani/feature-eng-ideas-and-lightgbm-cmi</a></p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 2443746,
      "author_name": "",
      "author_url": "",
      "post_date": "2023-09-18T00:11:28.833000",
      "content": "",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2442901": "Every top scoring public notebook seems to this feature and Ican't understand what this means? Can anyone please exaplain??\n\n\"\"\"\nsignal_awake = dict(zip(range(1440), np.sin(np.linspace(0, np.pi, 1440) + 0.208 * np.pi) ** 24))\nsignal_onset = dict(zip(range(1440), np.sin(np.linspace(0, np.pi, 1440) + 0.555 * np.pi) ** 24))\n\ndf['signal_onset'] = (df.timestamp.dt.hour * 60 + df.timestamp.dt.minute).map(signal_onset).astype(np.float32)\ndf['signal_awake'] = (df.timestamp.dt.hour * 60 + df.timestamp.dt.minute).map(signal_awake).astype(np.float32)\n\n\"\"\"",
    "2443305": "Hi @abhranta it is actually to involve periodic signal instead of raw hour.\n\nYou can find more explanation on the notebook I made [here](https://www.kaggle.com/code/rimbax/detection-converting-hour-into-periodic-signal). Hope it answers your question",
    "2443142": "By the way, I am also curious what does Lids mean:\n\ndf['lids'] = np.maximum(0., df['enmo'] - 0.02)\n    df['lids'] = df['lids'].rolling(120, center=True, min_periods=1).agg('sum')\n    df['lids'] = 100 / (df['lids'] + 1)\n    df['lids'] = df['lids'].rolling(360, center=True, min_periods=1).agg('mean').astype(np.float32)\n\nThanks ",
    "2442911": "Dear @abhranta \n\n> \"*Every top scoring public notebook*\"\n\nWhich notebooks? Do you have a link?\n\nAll the best,\ncarl",
    "2443746": ""
  }
}