{
  "id": 441404,
  "title": "Z-Angle, how to interpret it?",
  "url": "/competitions/child-mind-institute-detect-sleep-states/discussion/441404",
  "author_name": "Fernando Melo",
  "post_date": "2023-09-18T15:20:09.047000",
  "votes": 3,
  "comment_count": 7,
  "views": 0,
  "content": "<p>In the Data section, the Z angle is described as<br>\n<code>refers to the angle of the arm relative to the vertical axis of the body</code></p>\n<p>And it raised me two questions,</p>\n<p>If the person is standing and the arm is relaxed, the angle between the body and the arm will be 0.</p>\n<p>If the person is lying on the bed, the angle between the arm and the body will also be 0.</p>\n<p>Is correct? Or am I interpreting it wrong?</p>\n<p>Second,<br>\nHow can Z-angle be negative? Shouldn't the range be between 0 and 180?</p>",
  "messages": [
    {
      "id": 2445162,
      "postDate": "2023-09-18T16:32:05.763Z",
      "content": "<p>Hi Fernando,</p>\n<p>A person standing up FOR ME doesn't make any sense since we want to measure sleeping hours \"to conduct large-scale studies of sleep.\" (on Kaggle Overview).  Unless we're dealing with sleepwalkers/somnambulists : )</p>\n<p>While lying, the arm (in horizontal position 0º) with the wrist-watch could be hanging out of the bed (max -90º or +90º? I think down is negative). We don't sleep with the arm pointing up (to the ceiling).  When I swim with my smartwatch I have to raise the arm up, out of the water, so that satellite signal is reached.  Though, we don't raise an arm UP (and keep in that position) when we're sleeping. </p>\n<p>So angles could vary between 0º - 90º ? Downward direction (gravitational force) from the horizontal plane.</p>\n<p>I got a very helpful comment by PatrickAIforFun:   He ended saying that he doesn't know: \"whether up or down is negative, but it should not matter too much.  I think down is negative (like we see on xy axis graphs)</p>\n<p>Patrick's comment:<br>\n\"I appreciate your efforts of trying to visualize and explain the angle-z feature, BUT I strongly believe your understanding/visualization of it is WRONG. I don't want to come about as rude, I kust want to share my understanding of it and help clear up the confusion.<br>\nAs I've a lot of experience working with angle measurements from accelerometer data in the robotic field and have worked with wrist worn accelerometer data before, I hope I can clear up the confusion.<br>\nImagine wearing a wristwatch. This watch has an integrated accelerometer (as most smart watches do). The Z-Axis of this accelerometer is pointing upwards by convention. Thus, if you war the watch and look at the time, the Z-Axis is directly pointing into your face. If you leave your arms hanging, the Z-Axis of the watch is facing away from your body in the horizontal plane. Using accelerometer data, one can only measure/calculate the angle relative to the horizontal plane (because we basicslly measure the downwards direction relative to the device based on gravitational force). The angle described in your video (around the bodies vertical axis) however, can only be measured by a magnetometer (basically an electrical compass).<br>\nBased on this information, an angle-z of 0 degrees corresponds to a position, where you have your arms hanging down ans the watch is facing away from your body (in the horizontal plane). Looking at your watch (pointing it straight into the sky) would result in the maxium possible angle (90°, if the signal would be perfect). Contrary, looking at your palms (pointing the watch downwards into the ground) would result in -90°. (I am not 100% certain about the sign of the signal, whether up or down is negative, but it should not matter too much).\"</p>\n<p>Let me know what you think about this interpretation.\"</p>\n<p>Also, thank you Georgii.</p>",
      "rawMarkdown": "Hi Fernando,\n\nA person standing up FOR ME doesn't make any sense since we want to measure sleeping hours \"to conduct large-scale studies of sleep.\" (on Kaggle Overview).  Unless we're dealing with sleepwalkers/somnambulists : )\n\nWhile lying, the arm (in horizontal position 0º) with the wrist-watch could be hanging out of the bed (max -90º or +90º? I think down is negative). We don't sleep with the arm pointing up (to the ceiling).  When I swim with my smartwatch I have to raise the arm up, out of the water, so that satellite signal is reached.  Though, we don't raise an arm UP (and keep in that position) when we're sleeping. \n\nSo angles could vary between 0º - 90º ? Downward direction (gravitational force) from the horizontal plane.\n\nI got a very helpful comment by PatrickAIforFun:   He ended saying that he doesn't know: \"whether up or down is negative, but it should not matter too much.  I think down is negative (like we see on xy axis graphs)\n\nPatrick's comment:\n\"I appreciate your efforts of trying to visualize and explain the angle-z feature, BUT I strongly believe your understanding/visualization of it is WRONG. I don't want to come about as rude, I kust want to share my understanding of it and help clear up the confusion.\nAs I've a lot of experience working with angle measurements from accelerometer data in the robotic field and have worked with wrist worn accelerometer data before, I hope I can clear up the confusion.\nImagine wearing a wristwatch. This watch has an integrated accelerometer (as most smart watches do). The Z-Axis of this accelerometer is pointing upwards by convention. Thus, if you war the watch and look at the time, the Z-Axis is directly pointing into your face. If you leave your arms hanging, the Z-Axis of the watch is facing away from your body in the horizontal plane. Using accelerometer data, one can only measure/calculate the angle relative to the horizontal plane (because we basicslly measure the downwards direction relative to the device based on gravitational force). The angle described in your video (around the bodies vertical axis) however, can only be measured by a magnetometer (basically an electrical compass).\nBased on this information, an angle-z of 0 degrees corresponds to a position, where you have your arms hanging down ans the watch is facing away from your body (in the horizontal plane). Looking at your watch (pointing it straight into the sky) would result in the maxium possible angle (90°, if the signal would be perfect). Contrary, looking at your palms (pointing the watch downwards into the ground) would result in -90°. (I am not 100% certain about the sign of the signal, whether up or down is negative, but it should not matter too much).\"\n\nLet me know what you think about this interpretation.\"\n\nAlso, thank you Georgii.",
      "votes": 5,
      "replies": [
        {
          "id": 2445550,
          "postDate": "2023-09-18T23:48:30.570Z",
          "content": "<p>Very comprehensive as always</p>",
          "rawMarkdown": "Very comprehensive as always",
          "votes": 2
        },
        {
          "id": 2446374,
          "postDate": "2023-09-19T11:56:59.503Z",
          "content": "<p>Hi Marilia, thanks for your explanation, but I still have some questions:</p>\n<p><code>A person standing up FOR ME doesn't make any sense since we want to measure sleeping hours \"to conduct large-scale studies of sleep.\" (on Kaggle Overview). Unless we're dealing with sleepwalkers/somnambulists : )</code></p>\n<p>Maybe I didn't understand correctly, but the data is collected all day, or at least close to bedtime, so the person can be standing or lying in bed. In this case, in both situations, the angle between the arm and body will be 0.</p>\n<p>Since the Z-Angle is relative to the body, we don't have the information relative to the floor, so I didn't understand how to know if the person is in bed or not.</p>",
          "rawMarkdown": "Hi Marilia, thanks for your explanation, but I still have some questions:\n\n`A person standing up FOR ME doesn't make any sense since we want to measure sleeping hours \"to conduct large-scale studies of sleep.\" (on Kaggle Overview). Unless we're dealing with sleepwalkers/somnambulists : )`\n\nMaybe I didn't understand correctly, but the data is collected all day, or at least close to bedtime, so the person can be standing or lying in bed. In this case, in both situations, the angle between the arm and body will be 0.\n\nSince the Z-Angle is relative to the body, we don't have the information relative to the floor, so I didn't understand how to know if the person is in bed or not.",
          "votes": 3,
          "replies": [
            {
              "id": 2446592,
              "postDate": "2023-09-19T13:56:42.230Z",
              "content": "<p>Fernando, </p>\n<p>Your doubt: \"Logs awake collected ALL DAY\".  I didn't read any mention about that. </p>\n<p>Though, devices collect data ALL time. However, Researchers decide what kind of data/moment of the logs will be used on their Researchs.</p>\n<p>On Competition Context: \"Current approaches for annotating sleep data include sleep logs, which are the gold standard for detecting the onset of sleep. However, they are impractical for many participants to use reliably, and fail to capture the nuanced difference between heading to bed and falling asleep (or, conversely, waking up and getting out of bed).\"</p>\n<p>If Hosts wrote that:<br>\n\" it's IMPRACTICAL and FAILED to CAPTURE the difference between HEADING to BED and falling asleep and Waking up and GETTING out of BED. <br>\nVery likely, they collected LYING moment since it's on BED.</p>\n<p>They didn't mention (or I could' t find it) any record/annotation while the Child is standing up. They only mentioned: Heading to bed or Getting out of the Bed.  </p>\n<p>Since the Competiton goal is to to detect sleep onset and wake, standing up or lying aren't the most important to focus on your Model.  </p>",
              "rawMarkdown": "Fernando, \n\nYour doubt: \"Logs awake collected ALL DAY\".  I didn't read any mention about that. \n\nThough, devices collect data ALL time. However, Researchers decide what kind of data/moment of the logs will be used on their Researchs.\n  \nOn Competition Context: \"Current approaches for annotating sleep data include sleep logs, which are the gold standard for detecting the onset of sleep. However, they are impractical for many participants to use reliably, and fail to capture the nuanced difference between heading to bed and falling asleep (or, conversely, waking up and getting out of bed).\"\n\nIf Hosts wrote that:\n\" it's IMPRACTICAL and FAILED to CAPTURE the difference between HEADING to BED and falling asleep and Waking up and GETTING out of BED. \nVery likely, they collected LYING moment since it's on BED.\n\nThey didn't mention (or I could' t find it) any record/annotation while the Child is standing up. They only mentioned: Heading to bed or Getting out of the Bed.  \n\nSince the Competiton goal is to to detect sleep onset and wake, standing up or lying aren't the most important to focus on your Model.  ",
              "votes": 1
            }
          ]
        },
        {
          "id": 2447135,
          "postDate": "2023-09-19T21:02:07.127Z",
          "rawMarkdown": "",
          "votes": 1,
          "isDeleted": true,
          "replies": [
            {
              "id": 2447146,
              "postDate": "2023-09-19T21:36:56.503Z",
              "content": "<p>Hi Simon,<br>\nI can speak for myself. When I was 13 years old, I got measles (rubella). The only synthom was the extreme weakness.<br>\nWhen I went with my mother walking on the street, she was holding my hand and I kept walking with my eyes closed.</p>\n<p>And people said, \"look the child (I was small for 13y) is  walking sleeping\". I only remember that cause my mother told me. Thank the duration was just one week.</p>\n<p>Though insomnia can have many reasons. Sleepwalking is an exception.</p>",
              "rawMarkdown": "Hi Simon,\nI can speak for myself. When I was 13 years old, I got measles (rubella). The only synthom was the extreme weakness.\nWhen I went with my mother walking on the street, she was holding my hand and I kept walking with my eyes closed.\n\nAnd people said, \"look the child (I was small for 13y) is  walking sleeping\". I only remember that cause my mother told me. Thank the duration was just one week.\n\nThough insomnia can have many reasons. Sleepwalking is an exception."
            }
          ]
        }
      ]
    },
    {
      "id": 2445008,
      "postDate": "2023-09-18T15:20:09.047Z",
      "content": "<p>In the Data section, the Z angle is described as<br>\n<code>refers to the angle of the arm relative to the vertical axis of the body</code></p>\n<p>And it raised me two questions,</p>\n<p>If the person is standing and the arm is relaxed, the angle between the body and the arm will be 0.</p>\n<p>If the person is lying on the bed, the angle between the arm and the body will also be 0.</p>\n<p>Is correct? Or am I interpreting it wrong?</p>\n<p>Second,<br>\nHow can Z-angle be negative? Shouldn't the range be between 0 and 180?</p>",
      "rawMarkdown": "In the Data section, the Z angle is described as\n`refers to the angle of the arm relative to the vertical axis of the body`\n\nAnd it raised me two questions,\n\nIf the person is standing and the arm is relaxed, the angle between the body and the arm will be 0.\n\nIf the person is lying on the bed, the angle between the arm and the body will also be 0.\n\nIs correct? Or am I interpreting it wrong?\n\n\nSecond,\nHow can Z-angle be negative? Shouldn't the range be between 0 and 180?",
      "votes": 3
    },
    {
      "id": 2445066,
      "postDate": "2023-09-18T15:46:00.123Z",
      "content": "<p><a href=\"https://www.kaggle.com/nandodmelo\" target=\"_blank\">@nandodmelo</a> : Hey Fernando, you may want to refer to the good piece by <a href=\"https://www.kaggle.com/mpwolke\" target=\"_blank\">@mpwolke</a> on it, per <a href=\"https://www.kaggle.com/code/mpwolke/the-zzzs-anglez-aka-z-angle\" target=\"_blank\">The Zzzs: Anglez aka z-Angle</a></p>\n<p>I hope it is helpful.</p>",
      "rawMarkdown": "@nandodmelo : Hey Fernando, you may want to refer to the good piece by @mpwolke on it, per [The Zzzs: Anglez aka z-Angle](https://www.kaggle.com/code/mpwolke/the-zzzs-anglez-aka-z-angle)\n\nI hope it is helpful.",
      "votes": 2
    }
  ],
  "comments": [
    {
      "id": 2445162,
      "author_name": "Marília Prata",
      "author_url": "",
      "post_date": "2023-09-18T16:32:05.763000",
      "content": "<p>Hi Fernando,</p>\n<p>A person standing up FOR ME doesn't make any sense since we want to measure sleeping hours \"to conduct large-scale studies of sleep.\" (on Kaggle Overview).  Unless we're dealing with sleepwalkers/somnambulists : )</p>\n<p>While lying, the arm (in horizontal position 0º) with the wrist-watch could be hanging out of the bed (max -90º or +90º? I think down is negative). We don't sleep with the arm pointing up (to the ceiling).  When I swim with my smartwatch I have to raise the arm up, out of the water, so that satellite signal is reached.  Though, we don't raise an arm UP (and keep in that position) when we're sleeping. </p>\n<p>So angles could vary between 0º - 90º ? Downward direction (gravitational force) from the horizontal plane.</p>\n<p>I got a very helpful comment by PatrickAIforFun:   He ended saying that he doesn't know: \"whether up or down is negative, but it should not matter too much.  I think down is negative (like we see on xy axis graphs)</p>\n<p>Patrick's comment:<br>\n\"I appreciate your efforts of trying to visualize and explain the angle-z feature, BUT I strongly believe your understanding/visualization of it is WRONG. I don't want to come about as rude, I kust want to share my understanding of it and help clear up the confusion.<br>\nAs I've a lot of experience working with angle measurements from accelerometer data in the robotic field and have worked with wrist worn accelerometer data before, I hope I can clear up the confusion.<br>\nImagine wearing a wristwatch. This watch has an integrated accelerometer (as most smart watches do). The Z-Axis of this accelerometer is pointing upwards by convention. Thus, if you war the watch and look at the time, the Z-Axis is directly pointing into your face. If you leave your arms hanging, the Z-Axis of the watch is facing away from your body in the horizontal plane. Using accelerometer data, one can only measure/calculate the angle relative to the horizontal plane (because we basicslly measure the downwards direction relative to the device based on gravitational force). The angle described in your video (around the bodies vertical axis) however, can only be measured by a magnetometer (basically an electrical compass).<br>\nBased on this information, an angle-z of 0 degrees corresponds to a position, where you have your arms hanging down ans the watch is facing away from your body (in the horizontal plane). Looking at your watch (pointing it straight into the sky) would result in the maxium possible angle (90°, if the signal would be perfect). Contrary, looking at your palms (pointing the watch downwards into the ground) would result in -90°. (I am not 100% certain about the sign of the signal, whether up or down is negative, but it should not matter too much).\"</p>\n<p>Let me know what you think about this interpretation.\"</p>\n<p>Also, thank you Georgii.</p>",
      "votes": 5,
      "replies": [
        {
          "id": 2445550,
          "author_name": "Rimba Erlangga",
          "author_url": "",
          "post_date": "2023-09-18T23:48:30.570000",
          "content": "<p>Very comprehensive as always</p>",
          "votes": 2,
          "replies": []
        },
        {
          "id": 2446374,
          "author_name": "Fernando Melo",
          "author_url": "",
          "post_date": "2023-09-19T11:56:59.503000",
          "content": "<p>Hi Marilia, thanks for your explanation, but I still have some questions:</p>\n<p><code>A person standing up FOR ME doesn't make any sense since we want to measure sleeping hours \"to conduct large-scale studies of sleep.\" (on Kaggle Overview). Unless we're dealing with sleepwalkers/somnambulists : )</code></p>\n<p>Maybe I didn't understand correctly, but the data is collected all day, or at least close to bedtime, so the person can be standing or lying in bed. In this case, in both situations, the angle between the arm and body will be 0.</p>\n<p>Since the Z-Angle is relative to the body, we don't have the information relative to the floor, so I didn't understand how to know if the person is in bed or not.</p>",
          "votes": 3,
          "replies": [
            {
              "id": 2446592,
              "author_name": "Marília Prata",
              "author_url": "",
              "post_date": "2023-09-19T13:56:42.230000",
              "content": "<p>Fernando, </p>\n<p>Your doubt: \"Logs awake collected ALL DAY\".  I didn't read any mention about that. </p>\n<p>Though, devices collect data ALL time. However, Researchers decide what kind of data/moment of the logs will be used on their Researchs.</p>\n<p>On Competition Context: \"Current approaches for annotating sleep data include sleep logs, which are the gold standard for detecting the onset of sleep. However, they are impractical for many participants to use reliably, and fail to capture the nuanced difference between heading to bed and falling asleep (or, conversely, waking up and getting out of bed).\"</p>\n<p>If Hosts wrote that:<br>\n\" it's IMPRACTICAL and FAILED to CAPTURE the difference between HEADING to BED and falling asleep and Waking up and GETTING out of BED. <br>\nVery likely, they collected LYING moment since it's on BED.</p>\n<p>They didn't mention (or I could' t find it) any record/annotation while the Child is standing up. They only mentioned: Heading to bed or Getting out of the Bed.  </p>\n<p>Since the Competiton goal is to to detect sleep onset and wake, standing up or lying aren't the most important to focus on your Model.  </p>",
              "votes": 1,
              "replies": []
            }
          ]
        },
        {
          "id": 2447135,
          "author_name": "",
          "author_url": "",
          "post_date": "2023-09-19T21:02:07.127000",
          "content": "",
          "votes": 1,
          "replies": [
            {
              "id": 2447146,
              "author_name": "Marília Prata",
              "author_url": "",
              "post_date": "2023-09-19T21:36:56.503000",
              "content": "<p>Hi Simon,<br>\nI can speak for myself. When I was 13 years old, I got measles (rubella). The only synthom was the extreme weakness.<br>\nWhen I went with my mother walking on the street, she was holding my hand and I kept walking with my eyes closed.</p>\n<p>And people said, \"look the child (I was small for 13y) is  walking sleeping\". I only remember that cause my mother told me. Thank the duration was just one week.</p>\n<p>Though insomnia can have many reasons. Sleepwalking is an exception.</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2445066,
      "author_name": "Georgii Vyshnia",
      "author_url": "",
      "post_date": "2023-09-18T15:46:00.123000",
      "content": "<p><a href=\"https://www.kaggle.com/nandodmelo\" target=\"_blank\">@nandodmelo</a> : Hey Fernando, you may want to refer to the good piece by <a href=\"https://www.kaggle.com/mpwolke\" target=\"_blank\">@mpwolke</a> on it, per <a href=\"https://www.kaggle.com/code/mpwolke/the-zzzs-anglez-aka-z-angle\" target=\"_blank\">The Zzzs: Anglez aka z-Angle</a></p>\n<p>I hope it is helpful.</p>",
      "votes": 2,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2445162": "Hi Fernando,\n\nA person standing up FOR ME doesn't make any sense since we want to measure sleeping hours \"to conduct large-scale studies of sleep.\" (on Kaggle Overview).  Unless we're dealing with sleepwalkers/somnambulists : )\n\nWhile lying, the arm (in horizontal position 0º) with the wrist-watch could be hanging out of the bed (max -90º or +90º? I think down is negative). We don't sleep with the arm pointing up (to the ceiling).  When I swim with my smartwatch I have to raise the arm up, out of the water, so that satellite signal is reached.  Though, we don't raise an arm UP (and keep in that position) when we're sleeping. \n\nSo angles could vary between 0º - 90º ? Downward direction (gravitational force) from the horizontal plane.\n\nI got a very helpful comment by PatrickAIforFun:   He ended saying that he doesn't know: \"whether up or down is negative, but it should not matter too much.  I think down is negative (like we see on xy axis graphs)\n\nPatrick's comment:\n\"I appreciate your efforts of trying to visualize and explain the angle-z feature, BUT I strongly believe your understanding/visualization of it is WRONG. I don't want to come about as rude, I kust want to share my understanding of it and help clear up the confusion.\nAs I've a lot of experience working with angle measurements from accelerometer data in the robotic field and have worked with wrist worn accelerometer data before, I hope I can clear up the confusion.\nImagine wearing a wristwatch. This watch has an integrated accelerometer (as most smart watches do). The Z-Axis of this accelerometer is pointing upwards by convention. Thus, if you war the watch and look at the time, the Z-Axis is directly pointing into your face. If you leave your arms hanging, the Z-Axis of the watch is facing away from your body in the horizontal plane. Using accelerometer data, one can only measure/calculate the angle relative to the horizontal plane (because we basicslly measure the downwards direction relative to the device based on gravitational force). The angle described in your video (around the bodies vertical axis) however, can only be measured by a magnetometer (basically an electrical compass).\nBased on this information, an angle-z of 0 degrees corresponds to a position, where you have your arms hanging down ans the watch is facing away from your body (in the horizontal plane). Looking at your watch (pointing it straight into the sky) would result in the maxium possible angle (90°, if the signal would be perfect). Contrary, looking at your palms (pointing the watch downwards into the ground) would result in -90°. (I am not 100% certain about the sign of the signal, whether up or down is negative, but it should not matter too much).\"\n\nLet me know what you think about this interpretation.\"\n\nAlso, thank you Georgii.",
    "2445008": "In the Data section, the Z angle is described as\n`refers to the angle of the arm relative to the vertical axis of the body`\n\nAnd it raised me two questions,\n\nIf the person is standing and the arm is relaxed, the angle between the body and the arm will be 0.\n\nIf the person is lying on the bed, the angle between the arm and the body will also be 0.\n\nIs correct? Or am I interpreting it wrong?\n\n\nSecond,\nHow can Z-angle be negative? Shouldn't the range be between 0 and 180?",
    "2445066": "@nandodmelo : Hey Fernando, you may want to refer to the good piece by @mpwolke on it, per [The Zzzs: Anglez aka z-Angle](https://www.kaggle.com/code/mpwolke/the-zzzs-anglez-aka-z-angle)\n\nI hope it is helpful."
  }
}