Fitbit #121
carissalow
started this conversation in
Behavioral Features
Fitbit
#121
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally posted by @Meng6
For
heartrate
sensor orsleep
sensor, we extracted two files from the Fitbit raw data: summary data and intraday data. Forstep
sensor, we only extracted intraday data.1. Heartrate Sensor
Data Pre-processing
Summary data (
fitbit_heartrate_summary_with_datetime.csv
) contains daily features extracted by Fitbit directly: "restinghr", "caloriesoutofrange", "caloriesfatburn", "caloriescardio", "caloriespeak".Intraday data (
fitbit_heartrate_intraday_with_datetime.csv
) contains theheartrate
column andheartrate_zone
column during every time interval (e.g. 15s, 1min). According to Fitbit doc, we assign aheartrate_zone
(outofrange, fatburn, cardio, peak) for each row (time period).Feature Extraction
We extract features for different day segments (epochs) from intraday data: "maxhr", "minhr", "avghr", "medianhr", "modehr", "stdhr", "diffmaxmodehr", "diffminmodehr", "entropyhr", "minutesonoutofrangezone", "minutesonfatburnzone", "minutesoncardiozone", “minutesonpeakzone".
2. Sleep Sensor
Data Pre-processing
There are two versions of Fitbit’s sleep API (version 1 and version 1.2), and each provides raw sleep data in a different format. We extract summary data (
fitbit_sleep_summary_with_datetime.csv
) and Intraday data (fitbit_sleep_intraday_with_datetime.csv
) according to the following rules:v1
, sleep level is an integer with three possible values (1, 2, 3) while inv1.2
is a string. We convert integer levels to strings,asleep
,restless
orawake
respectively.v1
containscount_awake
,duration_awake
,count_awakenings
,count_restless
, andduration_restless
fields for every sleep record whilev1.2
does not.v1.2
has two types of sleep records:classic
andstages
. Theclassic
type contains three sleep levels:awake
,restless
andasleep
. Thestages
type contains four sleep levels:wake
,deep
,light
, andrem
. Sleep records fromv1
will have the same sleep levels asv1.2
classic type; therefore we set their type toclassic
.unified_level
. Based on this Fitbit forum post , we merge levels into two categories:classic
type unified_level is one of {0, 1} where 0 means awake and groupsawake
+restless
, while 1 means asleep and groupsasleep
.stages
type, unified_level is one of {0, 1} where 0 means awake and groupswake
while 1 means asleep and groupsdeep
+light
+rem
.v1.2
, records of typestages
containshortData
in addition todata
. We merge both to extract intraday data.data
contains sleep stages and any wake periods > 3 minutes (180 seconds).shortData
contains short wake periods representing physiological awakenings that are <= 3 minutes (180 seconds).efficiency
,minutes_after_wakeup
,minutes_asleep
,minutes_awake
,minutes_to_fall_asleep
,minutes_in_bed
,is_main_sleep
andtype
original_level
,is_main_sleep
andtype
. We computeunified_level
as explained above.Here are the columns (except time related columns) we’ve got:
Summary data: each row is one sleep record
v1.2
: "efficiency", "minutes_after_wakeup", "minutes_asleep", "minutes_awake", "minutes_to_fall_asleep", "minutes_in_bed", "is_main_sleep", "type"v1
:v1.2
’s columns + ["count_awake", "duration_awake", "count_awakenings", "count_restless", "duration_restless"]Intraday data: "original_level", "unified_level", "is_main_sleep", "type"
classic
type: sleep information of every 60sstages
type: sleep information of every 30sFeature Extraction
Currently, RAPIDS only extracts daily features from summary data: ["sumdurationafterwakeup", "sumdurationasleep", "sumdurationawake", "sumdurationtofallasleep", "sumdurationinbed", "avgefficiency", “countepisode"] for
main
/nap
/all
sleep periods.3. Step Sensor
Data Pre-processing
Only intraday data (
fitbit_step_intraday_with_datetime.csv
) is parsed from step raw data. It contains thesteps
(step count) column during every time interval (e.g. 1min).Feature Extraction
We extract features for different epochs from intraday data according to the following rules:
THRESHOLD_ACTIVE_BOUT
(default value is 10), that minute is labelled as sedentary, otherwise, is labelled as active. Active and sedentary bouts are periods of consecutive minutes labelled asactive
orsedentary
.validsensedminutes
feature is not available for Step sensor as we cannot determine the valid minutes based on the raw Fitbit step data.FIXED
time periods of each day, you can define the start time and end time in config.yaml. (2) exclude theFITBIT_BASED
time periods according to sleep summary data. (is_main_sleep
!= "main")Here is the list of features:
Beta Was this translation helpful? Give feedback.
All reactions