A Quest For Better Sleep
(with Fitbit data analysis)
Alex Martinelli | @5agado
● The Data
● Exploring Sleep Data
● The Heatmap Case
● What’s Next?
Be your own data scientist!
How data “works”: play with it, learn about tools, statistics and biases.
Learn to give a meaning to data < learn to give a proper meaning to data.
How you “work”: an app dashboard is not enough.
Investigation based on your needs and knowledge: insight, diagnosis, experiments
Premise: sleep trackers and their inherent inaccuracy
The Fitbit case
Getting your data is not as easy as expected, considering that is YOUR data.
Options: premium plan, scraping or APIs (again with limitations)
Data format (cleaned)
For each minute: 0=None (no measure taken), 1=Sleeping, 2=Restless, 3=Awake
Sleeping periods can be manually recorded, or are otherwise recognized
automatically (based on amount of time you didn’t move, so there are limitations).
Exploring Sleep Data
- sleep efficiency, hours of sleep...
- to bed time, wake up time
- sleep intervals
Intraday Stats (minute to minute analysis)
Aggregation (hour, weekday, month, year)
“Looks cool, but what does it mean?”
Minute Sleep Quality
For each minute, what percentage of recorded “times in bed” I was actually asleep
Premise: just observations. We need more formal experiments to show causal
● No correlation between steps and sleep quality (see next slide image)
● Daily heart resting rate negatively correlates with sleep efficiency
● Alcohol: asleep instantly, less restless, but more awakenings
Melatonin: decrease in sleep efficiency, while minor increase with 5HTP
Not enough data for vitamin B complex
● More data for correlation (drinking, eating, activity, cognitive performances,
habits and routines)
● Self experimentation to support causal relationship hypotheses
● Predictive models?
● Real quality data: EEG integration
● A personal quirky case: lucid dreaming
1. Introductory article for this project
2. Github repository with project code (https://github.com/5agado/fitbit-analyzer)
3. Intraday data via personal apps - Fitbit announcement post
4. Study on Fitbit accuracy on sleep measurements (https://www.ncbi.nlm.nih.gov/pubmed/21971963)
5. Cross-sectional study on the validity of consumer-level wearables