diff --git a/dev/404.html b/dev/404.html index cfd91e2d..6515636d 100644 --- a/dev/404.html +++ b/dev/404.html @@ -825,6 +825,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/change-log/index.html b/dev/change-log/index.html index 19c4fd0a..324795e7 100644 --- a/dev/change-log/index.html +++ b/dev/change-log/index.html @@ -830,6 +830,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/citation/index.html b/dev/citation/index.html index 5b884d7d..5fc5f909 100644 --- a/dev/citation/index.html +++ b/dev/citation/index.html @@ -912,6 +912,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/code_of_conduct/index.html b/dev/code_of_conduct/index.html index efe6d946..170cbbba 100644 --- a/dev/code_of_conduct/index.html +++ b/dev/code_of_conduct/index.html @@ -830,6 +830,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/developers/documentation/index.html b/dev/developers/documentation/index.html index 226b6631..08b1de63 100644 --- a/dev/developers/documentation/index.html +++ b/dev/developers/documentation/index.html @@ -830,6 +830,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/developers/git-flow/index.html b/dev/developers/git-flow/index.html index a47b8ac2..c6306227 100644 --- a/dev/developers/git-flow/index.html +++ b/dev/developers/git-flow/index.html @@ -830,6 +830,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/developers/remote-support/index.html b/dev/developers/remote-support/index.html index 4c46123c..0b9934cb 100644 --- a/dev/developers/remote-support/index.html +++ b/dev/developers/remote-support/index.html @@ -830,6 +830,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/developers/test-cases/index.html b/dev/developers/test-cases/index.html index c8ed191f..373ad9b2 100644 --- a/dev/developers/test-cases/index.html +++ b/dev/developers/test-cases/index.html @@ -830,6 +830,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/developers/testing/index.html b/dev/developers/testing/index.html index 62ea65e7..f3133a8e 100644 --- a/dev/developers/testing/index.html +++ b/dev/developers/testing/index.html @@ -830,6 +830,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/developers/validation-schema-config/index.html b/dev/developers/validation-schema-config/index.html index dff5fe85..845041cb 100644 --- a/dev/developers/validation-schema-config/index.html +++ b/dev/developers/validation-schema-config/index.html @@ -830,6 +830,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/developers/virtual-environments/index.html b/dev/developers/virtual-environments/index.html index 042fdff1..e9e052ae 100644 --- a/dev/developers/virtual-environments/index.html +++ b/dev/developers/virtual-environments/index.html @@ -830,6 +830,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/faq/index.html b/dev/faq/index.html index 2fc6c9c5..08b6783a 100644 --- a/dev/faq/index.html +++ b/dev/faq/index.html @@ -830,6 +830,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/add-new-features/index.html b/dev/features/add-new-features/index.html index ab9748cf..f07ed120 100644 --- a/dev/features/add-new-features/index.html +++ b/dev/features/add-new-features/index.html @@ -832,6 +832,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary @@ -1516,6 +1530,7 @@
  • Fitbit Heart Rate Summary
  • Fitbit Heart Rate Intraday
  • Fitbit Sleep Summary
  • +
  • Fitbit Sleep Intraday
  • Fitbit Steps Summary
  • Fitbit Steps Intraday
  • diff --git a/dev/features/empatica-accelerometer/index.html b/dev/features/empatica-accelerometer/index.html index 0374ef57..1687d8b7 100644 --- a/dev/features/empatica-accelerometer/index.html +++ b/dev/features/empatica-accelerometer/index.html @@ -832,6 +832,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/empatica-blood-volume-pulse/index.html b/dev/features/empatica-blood-volume-pulse/index.html index b62d9f68..5acea78d 100644 --- a/dev/features/empatica-blood-volume-pulse/index.html +++ b/dev/features/empatica-blood-volume-pulse/index.html @@ -832,6 +832,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/empatica-electrodermal-activity/index.html b/dev/features/empatica-electrodermal-activity/index.html index eb97302e..27f524fe 100644 --- a/dev/features/empatica-electrodermal-activity/index.html +++ b/dev/features/empatica-electrodermal-activity/index.html @@ -832,6 +832,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/empatica-heartrate/index.html b/dev/features/empatica-heartrate/index.html index b8b9b615..9af8d9f2 100644 --- a/dev/features/empatica-heartrate/index.html +++ b/dev/features/empatica-heartrate/index.html @@ -832,6 +832,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/empatica-inter-beat-interval/index.html b/dev/features/empatica-inter-beat-interval/index.html index ba9a297a..a5aa79fd 100644 --- a/dev/features/empatica-inter-beat-interval/index.html +++ b/dev/features/empatica-inter-beat-interval/index.html @@ -832,6 +832,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/empatica-tags/index.html b/dev/features/empatica-tags/index.html index e3f2ad51..7e8e2475 100644 --- a/dev/features/empatica-tags/index.html +++ b/dev/features/empatica-tags/index.html @@ -832,6 +832,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/empatica-temperature/index.html b/dev/features/empatica-temperature/index.html index 01a58179..ee833f38 100644 --- a/dev/features/empatica-temperature/index.html +++ b/dev/features/empatica-temperature/index.html @@ -832,6 +832,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/feature-introduction/index.html b/dev/features/feature-introduction/index.html index 8ce51e8d..720a0e08 100644 --- a/dev/features/feature-introduction/index.html +++ b/dev/features/feature-introduction/index.html @@ -897,6 +897,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/fitbit-data-yield/index.html b/dev/features/fitbit-data-yield/index.html index 0fac470c..5ab065af 100644 --- a/dev/features/fitbit-data-yield/index.html +++ b/dev/features/fitbit-data-yield/index.html @@ -872,6 +872,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/fitbit-heartrate-intraday/index.html b/dev/features/fitbit-heartrate-intraday/index.html index 408802f2..a7d8314a 100644 --- a/dev/features/fitbit-heartrate-intraday/index.html +++ b/dev/features/fitbit-heartrate-intraday/index.html @@ -872,6 +872,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/fitbit-heartrate-summary/index.html b/dev/features/fitbit-heartrate-summary/index.html index 6a9e21f9..ad582a63 100644 --- a/dev/features/fitbit-heartrate-summary/index.html +++ b/dev/features/fitbit-heartrate-summary/index.html @@ -872,6 +872,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/fitbit-sleep-intraday/index.html b/dev/features/fitbit-sleep-intraday/index.html new file mode 100644 index 00000000..14f0be54 --- /dev/null +++ b/dev/features/fitbit-sleep-intraday/index.html @@ -0,0 +1,2197 @@ + + + + + + + + + + + + + + + + + + + + Fitbit Sleep Intraday - RAPIDS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + Skip to content + + +
    +
    + +
    + + + + + +
    + + +
    + +
    + + + + + + +
    +
    + + + +
    +
    +
    + + + + + + +
    +
    +
    + + + +
    +
    +
    + + +
    +
    +
    + + +
    +
    + + + + + + + +

    Fitbit Sleep Intraday

    +

    Sensor parameters description for [FITBIT_SLEEP_INTRADAY]:

    + + + + + + + + + + + + + +
    Key                             Description
    [TABLE]Database table name or file path where the sleep intraday data is stored. The configuration keys in Device Data Source Configuration control whether this parameter is interpreted as table or file.
    +

    The format of the column(s) containing the Fitbit sensor data can be JSON or PLAIN_TEXT. The data in JSON format is obtained directly from the Fitbit API. We support PLAIN_TEXT in case you already parsed your data and don’t have access to your participants’ Fitbit accounts anymore. If your data is in JSON format then summary and intraday data come packed together.

    +

    We provide examples of the input format that RAPIDS expects, note that both examples for JSON and PLAIN_TEXT are tabular and the actual format difference comes in the fitbit_data column (we truncate the JSON example for brevity).

    +
    Example of the structure of source data with Fitbit’s sleep API Version 1
    + + + + + + + + + + + + + + + + + + + + + +
    device_idfitbit_data
    a748ee1a-1d0b-4ae9-9074-279a2b6ba524{“sleep”: [{“awakeCount”: 2, “awakeDuration”: 3, “awakeningsCount”: 10, “dateOfSleep”: “2020-10-07”, “duration”: 8100000, “efficiency”: 91, “endTime”: “2020-10-07T18:10:00.000”, “isMainSleep”: true, “logId”: 14147921940, “minuteData”: [{“dateTime”: “15:55:00”, “value”: “3”}, {“dateTime”: “15:56:00”, “value”: “3”}, {“dateTime”: “15:57:00”, “value”: “2”},…], “minutesAfterWakeup”: 0, “minutesAsleep”: 123, “minutesAwake”: 12, “minutesToFallAsleep”: 0, “restlessCount”: 8, “restlessDuration”: 9, “startTime”: “2020-10-07T15:55:00.000”, “timeInBed”: 135}, {“awakeCount”: 0, “awakeDuration”: 0, “awakeningsCount”: 1, “dateOfSleep”: “2020-10-07”, “duration”: 3780000, “efficiency”: 100, “endTime”: “2020-10-07T10:52:30.000”, “isMainSleep”: false, “logId”: 14144903977, “minuteData”: [{“dateTime”: “09:49:00”, “value”: “1”}, {“dateTime”: “09:50:00”, “value”: “1”}, {“dateTime”: “09:51:00”, “value”: “1”},…], “minutesAfterWakeup”: 1, “minutesAsleep”: 62, “minutesAwake”: 0, “minutesToFallAsleep”: 0, “restlessCount”: 1, “restlessDuration”: 1, “startTime”: “2020-10-07T09:49:00.000”, “timeInBed”: 63}], “summary”: {“totalMinutesAsleep”: 185, “totalSleepRecords”: 2, “totalTimeInBed”: 198}}
    a748ee1a-1d0b-4ae9-9074-279a2b6ba524{“sleep”: [{“awakeCount”: 3, “awakeDuration”: 21, “awakeningsCount”: 16, “dateOfSleep”: “2020-10-08”, “duration”: 19260000, “efficiency”: 89, “endTime”: “2020-10-08T06:01:30.000”, “isMainSleep”: true, “logId”: 14150613895, “minuteData”: [{“dateTime”: “00:40:00”, “value”: “3”}, {“dateTime”: “00:41:00”, “value”: “3”}, {“dateTime”: “00:42:00”, “value”: “3”},…], “minutesAfterWakeup”: 0, “minutesAsleep”: 275, “minutesAwake”: 33, “minutesToFallAsleep”: 0, “restlessCount”: 13, “restlessDuration”: 25, “startTime”: “2020-10-08T00:40:00.000”, “timeInBed”: 321}], “summary”: {“totalMinutesAsleep”: 275, “totalSleepRecords”: 1, “totalTimeInBed”: 321}}
    a748ee1a-1d0b-4ae9-9074-279a2b6ba524{“sleep”: [{“awakeCount”: 1, “awakeDuration”: 3, “awakeningsCount”: 8, “dateOfSleep”: “2020-10-09”, “duration”: 19320000, “efficiency”: 96, “endTime”: “2020-10-09T05:57:30.000”, “isMainSleep”: true, “logId”: 14161136803, “minuteData”: [{“dateTime”: “00:35:30”, “value”: “2”}, {“dateTime”: “00:36:30”, “value”: “1”}, {“dateTime”: “00:37:30”, “value”: “1”},…], “minutesAfterWakeup”: 0, “minutesAsleep”: 309, “minutesAwake”: 13, “minutesToFallAsleep”: 0, “restlessCount”: 7, “restlessDuration”: 10, “startTime”: “2020-10-09T00:35:30.000”, “timeInBed”: 322}], “summary”: {“totalMinutesAsleep”: 309, “totalSleepRecords”: 1, “totalTimeInBed”: 322}}
    +
    +
    +

    All columns are mandatory, however, all except device_id, local_date_time and duration can be empty if you don’t have that data. Just have in mind that some features might be inaccurate or empty as type_episode_id, level, is_main_sleep, and type are used for sleep episodes extraction. type_episode_id is based on where it is extracted: if it is extracted from the 1st “minutesData” block, the type_episode_id field will be 0. Similarly, the kth block will be k-1. Actually, you only need to make sure rows extracted from the same “minutesData” block are assigned with the same unique type_episode_id value.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    device_idtype_episode_idlocal_date_timedurationlevelis_main_sleeptype
    a748ee1a-1d0b-4ae9-9074-279a2b6ba52402020-10-07 15:55:0060awake0classic
    a748ee1a-1d0b-4ae9-9074-279a2b6ba52402020-10-07 15:56:0060awake0classic
    a748ee1a-1d0b-4ae9-9074-279a2b6ba52402020-10-07 15:57:0060restless0classic
    +
    +
    +
    +
    Example of the structure of source data with Fitbit’s sleep API Version 1.2
    + + + + + + + + + + + + + + + + + + + + + +
    device_idfitbit_data
    a748ee1a-1d0b-4ae9-9074-279a2b6ba524{“sleep”:[{“dateOfSleep”:”2020-10-10”,”duration”:3600000,”efficiency”:92,”endTime”:”2020-10-10T16:37:00.000”,”infoCode”:2,”isMainSleep”:false,”levels”:{“data”:[{“dateTime”:”2020-10-10T15:36:30.000”,”level”:”restless”,”seconds”:60},{“dateTime”:”2020-10-10T15:37:30.000”,”level”:”asleep”,”seconds”:660},{“dateTime”:”2020-10-10T15:48:30.000”,”level”:”restless”,”seconds”:60},…], “summary”:{“asleep”:{“count”:0,”minutes”:56},”awake”:{“count”:0,”minutes”:0},”restless”:{“count”:3,”minutes”:4}}},”logId”:26315914306,”minutesAfterWakeup”:0,”minutesAsleep”:55,”minutesAwake”:5,”minutesToFallAsleep”:0,”startTime”:”2020-10-10T15:36:30.000”,”timeInBed”:60,”type”:”classic”},{“dateOfSleep”:”2020-10-10”,”duration”:22980000,”efficiency”:88,”endTime”:”2020-10-10T08:10:00.000”,”infoCode”:0,”isMainSleep”:true,”levels”:{“data”:[{“dateTime”:”2020-10-10T01:46:30.000”,”level”:”light”,”seconds”:420},{“dateTime”:”2020-10-10T01:53:30.000”,”level”:”deep”,”seconds”:1230},{“dateTime”:”2020-10-10T02:14:00.000”,”level”:”light”,”seconds”:360},…], “summary”:{“deep”:{“count”:3,”minutes”:92,”thirtyDayAvgMinutes”:0},”light”:{“count”:29,”minutes”:193,”thirtyDayAvgMinutes”:0},”rem”:{“count”:4,”minutes”:33,”thirtyDayAvgMinutes”:0},”wake”:{“count”:28,”minutes”:65,”thirtyDayAvgMinutes”:0}}},”logId”:26311786557,”minutesAfterWakeup”:0,”minutesAsleep”:318,”minutesAwake”:65,”minutesToFallAsleep”:0,”startTime”:”2020-10-10T01:46:30.000”,”timeInBed”:383,”type”:”stages”}],”summary”:{“stages”:{“deep”:92,”light”:193,”rem”:33,”wake”:65},”totalMinutesAsleep”:373,”totalSleepRecords”:2,”totalTimeInBed”:443}}
    a748ee1a-1d0b-4ae9-9074-279a2b6ba524{“sleep”:[{“dateOfSleep”:”2020-10-11”,”duration”:41640000,”efficiency”:89,”endTime”:”2020-10-11T11:47:00.000”,”infoCode”:0,”isMainSleep”:true,”levels”:{“data”:[{“dateTime”:”2020-10-11T00:12:30.000”,”level”:”wake”,”seconds”:450},{“dateTime”:”2020-10-11T00:20:00.000”,”level”:”light”,”seconds”:870},{“dateTime”:”2020-10-11T00:34:30.000”,”level”:”wake”,”seconds”:780},…], “summary”:{“deep”:{“count”:4,”minutes”:52,”thirtyDayAvgMinutes”:62},”light”:{“count”:32,”minutes”:442,”thirtyDayAvgMinutes”:364},”rem”:{“count”:6,”minutes”:68,”thirtyDayAvgMinutes”:58},”wake”:{“count”:29,”minutes”:132,”thirtyDayAvgMinutes”:94}}},”logId”:26589710670,”minutesAfterWakeup”:1,”minutesAsleep”:562,”minutesAwake”:132,”minutesToFallAsleep”:0,”startTime”:”2020-10-11T00:12:30.000”,”timeInBed”:694,”type”:”stages”}],”summary”:{“stages”:{“deep”:52,”light”:442,”rem”:68,”wake”:132},”totalMinutesAsleep”:562,”totalSleepRecords”:1,”totalTimeInBed”:694}}
    a748ee1a-1d0b-4ae9-9074-279a2b6ba524{“sleep”:[{“dateOfSleep”:”2020-10-12”,”duration”:28980000,”efficiency”:93,”endTime”:”2020-10-12T09:34:30.000”,”infoCode”:0,”isMainSleep”:true,”levels”:{“data”:[{“dateTime”:”2020-10-12T01:31:00.000”,”level”:”wake”,”seconds”:600},{“dateTime”:”2020-10-12T01:41:00.000”,”level”:”light”,”seconds”:60},{“dateTime”:”2020-10-12T01:42:00.000”,”level”:”deep”,”seconds”:2340},…], “summary”:{“deep”:{“count”:4,”minutes”:63,”thirtyDayAvgMinutes”:59},”light”:{“count”:27,”minutes”:257,”thirtyDayAvgMinutes”:364},”rem”:{“count”:5,”minutes”:94,”thirtyDayAvgMinutes”:58},”wake”:{“count”:24,”minutes”:69,”thirtyDayAvgMinutes”:95}}},”logId”:26589710673,”minutesAfterWakeup”:0,”minutesAsleep”:415,”minutesAwake”:68,”minutesToFallAsleep”:0,”startTime”:”2020-10-12T01:31:00.000”,”timeInBed”:483,”type”:”stages”}],”summary”:{“stages”:{“deep”:63,”light”:257,”rem”:94,”wake”:69},”totalMinutesAsleep”:415,”totalSleepRecords”:1,”totalTimeInBed”:483}}
    +
    +
    +

    All columns are mandatory, however, all except device_id, local_date_time and duration can be empty if you don’t have that data. Just have in mind that some features might be inaccurate or empty as type_episode_id, level, is_main_sleep, and type are used for sleep episodes extraction. type_episode_id is based on where it is extracted: if it is extracted from the 1st “data” and “shortData” block, the type_episode_id field will be 0. Similarly, the kth block will be k-1. Actually, you only need to make sure rows extracted from the same “minutesData” block are assigned with the same unique type_episode_id value.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    device_idtype_episode_idlocal_date_timedurationlevelis_main_sleeptype
    a748ee1a-1d0b-4ae9-9074-279a2b6ba52402020-10-10 15:36:3060restless0classic
    a748ee1a-1d0b-4ae9-9074-279a2b6ba52402020-10-10 15:37:30660asleep0classic
    a748ee1a-1d0b-4ae9-9074-279a2b6ba52402020-10-10 15:48:3060restless0classic
    a748ee1a-1d0b-4ae9-9074-279a2b6ba524
    a748ee1a-1d0b-4ae9-9074-279a2b6ba52412020-10-10 01:46:30420light1stages
    a748ee1a-1d0b-4ae9-9074-279a2b6ba52412020-10-10 01:53:301230deep1stages
    +
    +
    +
    +

    RAPIDS provider

    +
    +

    Available time segments

    +
      +
    • Available for all time segments
    • +
    +
    +
    +

    File Sequence

    +
    - data/raw/{pid}/fitbit_sleep_intraday_raw.csv
    +- data/raw/{pid}/fitbit_sleep_intraday_parsed.csv
    +- data/interim/{pid}/fitbit_sleep_intraday_episodes_resampled.csv
    +- data/interim/{pid}/fitbit_sleep_intraday_episodes_resampled_with_datetime.csv
    +- data/interim/{pid}/fitbit_sleep_intraday_features/fitbit_sleep_intraday_{language}_{provider_key}.csv
    +- data/processed/features/{pid}/fitbit_sleep_intraday.csv
    +
    +
    +

    Parameters description for [FITBIT_SLEEP_INTRADAY][PROVIDERS][RAPIDS]:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Key                             Description
    [COMPUTE]Set to True to extract FITBIT_SLEEP_INTRADAY features from the RAPIDS provider
    [FEATURES]Features to be computed from sleep intraday data, see table below
    [SLEEP_LEVELS]Fitbit’s sleep API Version 1 only provides CLASSIC records. However, Version 1.2 provides 2 types of records: CLASSIC and STAGES. STAGES is only available in devices with a heart rate sensor and even those devices will fail to report it if the battery is low or the device is not tight enough. While CLASSIC contains 3 sleep levels (awake, restless, and asleep), STAGES contains 4 sleep levels (wake, deep, light, rem). To make it consistent, RAPIDS grouped them into 2 UNIFIED sleep levels: awake (CLASSIC: awake and restless; STAGES: wake) and asleep (CLASSIC: asleep; STAGES: deep, light, and rem).
    [SLEEP_TYPES]Types of sleep to be included in the feature extraction computation. Fitbit provides 2 types of sleep: main, nap.
    [INCLUDE_SLEEP_LATER_THAN]All resampled sleep rows (bin interval: one minute) that started after this time will be included in the feature computation. It is a number ranging from 0 (midnight) to 1439 (23:59) which denotes the number of minutes after midnight. If a segment is longer than one day, this value is for every day.
    [REFERENCE_TIME]The reference point from which the [ROUTINE] features are to be computed. Chosen from MIDNIGHT and START_OF_THE_SEGMENT, default is MIDNIGHT. If you have multiple time segments per day it might be more informative to set this flag to START_OF_THE_SEGMENT.
    +

    Features description for [FITBIT_STEPS_INTRADAY][PROVIDERS][RAPIDS][LEVELS_AND_TYPES]:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Feature                                          UnitsDescription
    countepisode[LEVEL][TYPE]episodesNumber of [LEVEL][TYPE]sleep episodes. [LEVEL]is one of [SLEEP_LEVELS] (e.g. awake-classic or rem-stages) and [TYPE] is one of [SLEEP_TYPES] (e.g. main). Both [LEVEL]and [TYPE] can also be all when LEVELS_AND_TYPES_COMBINING_ALL is True, which ignores the levels and groups by sleep types.
    sumduration[LEVEL][TYPE]minutesTotal duration of all [LEVEL][TYPE]sleep episodes. [LEVEL]is one of [SLEEP_LEVELS] (e.g. awake-classic or rem-stages) and [TYPE] is one of [SLEEP_TYPES] (e.g. main). Both [LEVEL] and [TYPE]can also be all when LEVELS_AND_TYPES_COMBINING_ALL is True, which ignores the levels and groups by sleep types.
    maxduration[LEVEL][TYPE]minutesLongest duration of any [LEVEL][TYPE]sleep episode. [LEVEL]is one of [SLEEP_LEVELS] (e.g. awake-classic or rem-stages) and [TYPE] is one of [SLEEP_TYPES] (e.g. main). Both [LEVEL] and [TYPE]can also be all when LEVELS_AND_TYPES_COMBINING_ALL is True, which ignores the levels and groups by sleep types.
    minduration[LEVEL][TYPE]minutesShortest duration of any [LEVEL][TYPE]sleep episode. [LEVEL]is one of [SLEEP_LEVELS] (e.g. awake-classic or rem-stages) and [TYPE] is one of [SLEEP_TYPES] (e.g. main). Both [LEVEL] and [TYPE]can also be all when LEVELS_AND_TYPES_COMBINING_ALL is True, which ignores the levels and groups by sleep types.
    avgduration[LEVEL][TYPE]minutesAverage duration of all [LEVEL][TYPE]sleep episodes. [LEVEL]is one of [SLEEP_LEVELS] (e.g. awake-classic or rem-stages) and [TYPE] is one of [SLEEP_TYPES] (e.g. main). Both [LEVEL] and [TYPE]can also be all when LEVELS_AND_TYPES_COMBINING_ALL is True, which ignores the levels and groups by sleep types.
    medianduration[LEVEL][TYPE]minutesMedian duration of all [LEVEL][TYPE]sleep episodes. [LEVEL]is one of [SLEEP_LEVELS] (e.g. awake-classic or rem-stages) and [TYPE] is one of [SLEEP_TYPES] (e.g. main). Both [LEVEL] and [TYPE]can also be all when LEVELS_AND_TYPES_COMBINING_ALL is True, which ignores the levels and groups by sleep types.
    stdduration[LEVEL][TYPE]minutesStandard deviation duration of all [LEVEL][TYPE]sleep episodes. [LEVEL]is one of [SLEEP_LEVELS] (e.g. awake-classic or rem-stages) and [TYPE] is one of [SLEEP_TYPES] (e.g. main). Both [LEVEL] and [TYPE]can also be all when LEVELS_AND_TYPES_COMBINING_ALL is True, which ignores the levels and groups by sleep types.
    +

    Features description for [FITBIT_STEPS_INTRADAY][PROVIDERS][RAPIDS] RATIOS [ACROSS_LEVELS]:

    + + + + + + + + + + + + + + + + + + + + +
    Feature                           UnitsDescription
    ratiocount[LEVEL]-Ratio between the count of episodes of a single sleep [LEVEL] and the count of all episodes of all levels during both main and nap sleep types. This answers the question: what percentage of all wake, deep, light, and rem episodes were rem? (e.g., \(countepisode[remstages][all] / countepisode[all][all]\))
    ratioduration[LEVEL]-Ratio between the duration of episodes of a single sleep [LEVEL] and the duration of all episodes of all levels during both main and nap sleep types. This answers the question: what percentage of all wake, deep, light, and rem time was rem? (e.g., \(sumduration[remstages][all] / sumduration[all][all]\))
    +

    Features description for [FITBIT_STEPS_INTRADAY][PROVIDERS][RAPIDS] RATIOS [ACROSS_TYPES]:

    + + + + + + + + + + + + + + + + + + + + +
    Feature                           UnitsDescription
    ratiocountmain-Ratio between the count of all main episodes (independently of the levels inside) divided by the count of all main and nap episodes. This answers the question: what percentage of all sleep episodes (main and nap) were main? We do not provide the ratio for nap because is complementary. (\(countepisode[all][main] / countepisode[all][all]\))
    ratiodurationmain-Ratio between the duration of all main episodes (independently of the levels inside) divided by the duration of all main and nap episodes. This answers the question: what percentage of all sleep time (main and nap) was main? We do not provide the ratio for nap because is complementary. (\(sumduration[all][main] / sumduration[all][all]\))
    +

    Features description for [FITBIT_STEPS_INTRADAY][PROVIDERS][RAPIDS] RATIOS [WITHIN_LEVELS]:

    + + + + + + + + + + + + + + + + + + + + +
    Feature                           UnitsDescription
    ratiocount[TYPE]within[LEVEL]-Ratio between the count of episodes of a single sleep [LEVEL] during main sleep divided by the count of episodes of a single sleep [LEVEL] during main and nap. This answers the question: are rem episodes more frequent during main than nap sleep? We do not provide the ratio for nap because is complementary. (\(countepisode[remstages][main] / countepisode[remstages][all]\))
    ratioduration[TYPE]within[LEVEL]-Ratio between the duration of episodes of a single sleep [LEVEL] during main sleep divided by the duration of episodes of a single sleep [LEVEL] during main and nap. This answers the question: is rem time more frequent during main than nap sleep? We do not provide the ratio for nap because is complementary. (\(countepisode[remstages][main] / countepisode[remstages][all]\))
    +

    Features description for [FITBIT_STEPS_INTRADAY][PROVIDERS][RAPIDS] RATIOS [WITHIN_TYPES]:

    + + + + + + + + + + + + + + + + + + + + +
    Feature                                                   UnitsDescription
    ratiocount[LEVEL]within[TYPE]-Ratio between the count of episodes of a single sleep [LEVEL] and the count of all episodes of all levels during either main or nap sleep types. This answers the question: what percentage of all wake, deep, light, and rem episodes were rem during main/nap sleep time? (e.g., \(countepisode[remstages][main] / countepisode[all][main]\))
    ratioduration[LEVEL]within[TYPE]-Ratio between the duration of episodes of a single sleep [LEVEL] and the duration of all episodes of all levels during either main or nap sleep types. This answers the question: what percentage of all wake, deep, light, and rem time was rem during main/nap sleep time? (e.g., \(sumduration[remstages][main] / sumduration[all][main]\))
    +

    Features description for [FITBIT_STEPS_INTRADAY][PROVIDERS][RAPIDS][ROUTINE]:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FeatureUnitsDescription
    starttimefirstmainsleepminutesStart time (in minutes since REFERENCE_TIME) of the first main sleep episode after INCLUDE_EPISODES_LATER_THAN.
    endtimelastmainsleepminutesEnd time (in minutes since REFERENCE_TIME) of the last main sleep episode after INCLUDE_EPISODES_LATER_THAN.
    starttimefirstnapminutesStart time (in minutes since REFERENCE_TIME) of the first nap episode after INCLUDE_EPISODES_LATER_THAN.
    endtimelastnapminutesEnd time (in minutes since REFERENCE_TIME) of the last nap episode after INCLUDE_EPISODES_LATER_THAN.
    +
    +

    Assumptions/Observations

    +
      +
    1. Deleting values from [SLEEP_LEVELS] or [SLEEP_TYPES] will only change the features you receive from [LEVELS_AND_TYPES]. For example if STAGES only contains [rem, light] you will not receive countepisode[wake|deep][TYPE] or sum, max, min, avg, median, or std duration. These values will not influence RATIOS or ROUTINE features.
    2. +
    3. Any [LEVEL] grouping is done within the elements of each class CLASSIC, STAGES, and UNIFIED. That is, we never combine CLASSIC or STAGES types to compute features when LEVELS_AND_TYPES_COMBINING_ALL is True or when computing RATIOS.
    4. +
    +
    +

    PRICE provider

    +
    +

    Available time segments

    +
      +
    • Available for any time segments larger or equal to one day
    • +
    +
    +
    +

    File Sequence

    +
    - data/raw/{pid}/fitbit_sleep_intraday_raw.csv
    +- data/raw/{pid}/fitbit_sleep_intraday_parsed.csv
    +- data/interim/{pid}/fitbit_sleep_intraday_episodes_resampled.csv
    +- data/interim/{pid}/fitbit_sleep_intraday_episodes_resampled_with_datetime.csv
    +- data/interim/{pid}/fitbit_sleep_intraday_features/fitbit_sleep_intraday_{language}_{provider_key}.csv
    +- data/processed/features/{pid}/fitbit_sleep_intraday.csv
    +
    +
    +

    Parameters description for [FITBIT_SLEEP_INTRADAY][PROVIDERS][PRICE]:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Key                                                                 Description
    [COMPUTE]Set to True to extract FITBIT_SLEEP_INTRADAY features from the PRICE provider
    [FEATURES]Features to be computed from sleep intraday data, see table below
    [SLEEP_LEVELS]Fitbit’s sleep API Version 1 only provides CLASSIC records. However, Version 1.2 provides 2 types of records: CLASSIC and STAGES. STAGES is only available in devices with a heart rate sensor and even those devices will fail to report it if the battery is low or the device is not tight enough. While CLASSIC contains 3 sleep levels (awake, restless, and asleep), STAGES contains 4 sleep levels (wake, deep, light, rem). To make it consistent, RAPIDS grouped them into 2 UNIFIED sleep levels: awake (CLASSIC: awake and restless; STAGES: wake) and asleep (CLASSIC: asleep; STAGES: deep, light, and rem).
    [DAY_TYPE]The features of this provider can be computed using daily averages/standard deviations that were extracted on WEEKEND days only, WEEK days only, or ALL days
    [GROUP_EPISODES_WITHIN]This parameter contains 2 values: [START_TIME] and [LENGTH]. Only main sleep episodes that intersect or contain the period between [START_TIME, START_TIME + LENGTH] are taken into account to compute the features described below. Both [START_TIME] and [LENGTH] are in minutes. [START_TIME] is a number ranging from 0 (midnight) to 1439 (23:59) which denotes the number of minutes after midnight. [LENGTH] is a number smaller than 1440 (24 hours).
    +

    Features description for [FITBIT_STEPS_INTRADAY][PROVIDERS][PRICE]:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Feature                                                            UnitsDescription
    avgduration[LEVEL]main[DAY_TYPE]minutesAverage duration of daily LEVEL sleep episodes. You can include daily average that were computed on weekend days, week days or both depending on the value of the DAY_TYPE flag.
    avgratioduration[LEVEL]withinmain[DAY_TYPE]-Average ratio between daily LEVEL time and in-bed time inferred from main sleep episodes. LEVEL is one of SLEEP_LEVELS (e.g. awake-classic or rem-stages). In-bed time is the total duration of all main sleep episodes for each day. You can include daily ratios that were computed on weekend days, week days or both depending on the value of the DAY_TYPE flag.
    avgstarttimeofepisodemain[DAY_TYPE]minutesAverage start time of the first main sleep episode of each day in a time segment. You can include daily start times from episodes detected on weekend days, week days or both depending on the value of the DAY_TYPE flag.
    avgendtimeofepisodemain[DAY_TYPE]minutesAverage end time of the last main sleep episode of each day in a time segment. You can include daily end times from episodes detected on weekend days, week days or both depending on the value of the DAY_TYPE flag.
    avgmidpointofepisodemain[DAY_TYPE]minutesAverage mid time between the start of the first main sleep episode and the end of the last main sleep episode of each day in a time segment. You can include episodes detected on weekend days, week days or both depending on the value of the DAY_TYPE flag.
    stdstarttimeofepisodemain[DAY_TYPE]minutesStandard deviation of start time of the first main sleep episode of each day in a time segment. You can include daily start times from episodes detected on weekend days, week days or both depending on the value of the DAY_TYPE flag.
    stdendtimeofepisodemain[DAY_TYPE]minutesStandard deviation of end time of the last main sleep episode of each day in a time segment. You can include daily end times from episodes detected on weekend days, week days or both depending on the value of the DAY_TYPE flag.
    stdmidpointofepisodemain[DAY_TYPE]minutesStandard deviation of mid time between the start of the first main sleep episode and the end of the last main sleep episode of each day in a time segment. You can include episodes detected on weekend days, week days or both depending on the value of the DAY_TYPE flag.
    socialjetlagminutesDifference in minutes between the avgstarttimeofepisodemain (bed time) of weekends and weekdays.
    meanssdstarttimeofepisodemainminutes squaredSame as avgstarttimeofepisodemain[DAY_TYPE] but the average is computed over the squared differences of each pair of consecutive start times.
    meanssdendtimeofepisodemainminutes squaredSame as avgendtimeofepisodemain[DAY_TYPE] but the average is computed over the squared differences of each pair of consecutive end times.
    meanssdmidpointofepisodemainminutes squaredSame as avgmidpointofepisodemain[DAY_TYPE] but the average is computed over the squared differences of each pair of consecutive mid times.
    medianssdstarttimeofepisodemainminutes squaredSame as avgstarttimeofepisodemain[DAY_TYPE] but the median is computed over the squared differences of each pair of consecutive start times.
    medianssdendtimeofepisodemainminutes squaredSame as avgendtimeofepisodemain[DAY_TYPE] but the median is computed over the squared differences of each pair of consecutive end times.
    medianssdmidpointofepisodemainminutes squaredSame as avgmidpointofepisodemain[DAY_TYPE] but the median is computed over the squared differences of each pair of consecutive mid times.
    +
    +

    Assumptions/Observations

    +
      +
    1. These features are based on descriptive statistics computed across daily values (start/end/mid times of sleep episodes). This is the reason why they are only available on time segments that are longer than 24 hours (we need at least 1 day to get the average).
    2. +
    3. Even though Fitbit provides 2 types of sleep episodes (main and nap), only main sleep episodes are considered.
    4. +
    5. +

      How do we assign sleep episodes to specific dates?

      +

      START_TIME and LENGTH control the dates that sleep episodes belong to. For a pair of [START_TIME] and [LENGTH], sleep episodes (blue boxes) can only be placed at the following places:

      +

      + +
      Relationship between sleep episodes and the given times([START_TIME], [LENGTH])
      +

      +
        +
      • +

        If the end time of a sleep episode is before [START_TIME], it will belong to the day before its start date (e.g. sleep episode #1).

        +
      • +
      • +

        if (1) the start time or the end time of a sleep episode are between (overlap) [START_TIME] and [START_TIME] + [LENGTH] or (2) the start time is before [START_TIME] and the end time is after [START_TIME] + [LENGTH], it will belong to its start date (e.g. sleep episode #2, #3, #4, #5).

        +
      • +
      • +

        If the start time of a sleep episode is after START_TIME] + [LENGTH], it will belong to the day after its start date (e.g. sleep episode #6).

        +
      • +
      +

      Only main sleep episodes that intersect or contain the period between [START_TIME] and [START_TIME] + [LENGTH] will be included in the feature computation. If we process the following main sleep episodes:

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      episodestartend
      12021-02-01 12:002021-02-01 15:00
      22021-02-01 21:002021-02-02 03:00
      32021-02-02 05:002021-02-02 08:00
      42021-02-02 11:002021-02-02 14:00
      52021-02-02 19:002021-02-03 06:00
      +

      And our parameters:

      +
        +
      • +

        [INCLUDE_EPISODES_INTERSECTING][START_TIME] = 1320 (today’s 22:00)

        +
      • +
      • +

        [INCLUDE_EPISODES_INTERSECTING][LENGTH] = 720 (tomorrow’s 10:00, or 22:00 + 12 hours)

        +
      • +
      +

      Only sleep episodes 2, 3,and 5 would be considered.

      +
    6. +
    7. +

      Time related features represent the number of minutes between the start/end/midpoint of sleep episodes and the assigned day’s midnight.

      +
    8. +
    9. +

      All main sleep episodes are chunked within the requested time segments which need to be at least 24 hours or more long (1, 2, 3, 7 days, etc.). Then, daily features will be extracted and averaged across the length of the time segment, for example:

      +

      The daily features extracted on 2021-02-01 will be:

      +
        +
      • +

        starttimeofepisodemain (bedtime) is 21 * 60 (episode 2 start time 2021-02-01 21:00)

        +
      • +
      • +

        endtimeofepisodemain (wake time) is 32 * 60(episode 3 end time 2021-02-02 08:00 + 24)

        +
      • +
      • +

        midpointofepisodemain (midpoint sleep) is [(21 * 60) + (32 * 60)] / 2

        +
      • +
      +

      The daily features extracted on 2021-02-02 will be:

      +
        +
      • +

        starttimeofepisodemain (bedtime) is 19 * 60 (episode 5 start time 2021-02-01 19:00)

        +
      • +
      • +

        endtimeofepisodemain (wake time) is 30 * 60(episode 5 end time 2021-02-03 06:00 + 24)

        +
      • +
      • +

        midpointofepisodemain (midpoint sleep) is [(19 * 60) + (30 * 60)] / 2

        +
      • +
      +

      And avgstarttimeofepisodemain[DAY_TYPE] will be ([21 * 60] + [19 * 60]) / 2

      +
    10. +
    +
    + + + + + + + +
    +
    +
    +
    + + + + +
    + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dev/features/fitbit-sleep-summary/index.html b/dev/features/fitbit-sleep-summary/index.html index fd61c7fa..c1768a07 100644 --- a/dev/features/fitbit-sleep-summary/index.html +++ b/dev/features/fitbit-sleep-summary/index.html @@ -872,6 +872,20 @@ +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary @@ -1812,13 +1826,13 @@ -
  • + Fitbit Sleep Intraday + +
  • + + + + + + + + +
  • Fitbit Steps Summary diff --git a/dev/features/fitbit-steps-summary/index.html b/dev/features/fitbit-steps-summary/index.html index 4d358000..037f0ad2 100644 --- a/dev/features/fitbit-steps-summary/index.html +++ b/dev/features/fitbit-steps-summary/index.html @@ -833,6 +833,20 @@ + +
  • + + Fitbit Sleep Intraday + +
  • + + + + + + + + @@ -1575,7 +1589,7 @@