Post

Today I dove into my activity tracker data; specifically, the sleep score that Oura calculates daily. The intuition/assumption about it is pretty simple - more deep sleep and lower heart rate correlate with better scores. Is it that simple? Let's take a look in a quick data science experiment

First up I found the Oura developer API and got a quick dump of my activity/sleep data. Oura itself seems to have the most restrictive native way to look at your data (vs fitbit or garmin) so this is already a great find/idea if you want some more insights!

Step 2: we need a few lines to add the new data into an elasticsearch index so we can look through it easily. This was also super easy - as it tends to be with json files - so we didn't need any additional mapping or data processing steps.

Now comes our tiny data science experiment or hypothesis. I gathered the days with the highest sleep scores with a simple sort on the score field. sort="readiness.score:desc"

Looking a bit deeper at these days, and at the fields I already suspect had a pretty high influence on the scores, we notice some consistent values:

0 reposts0 likes

Finally, the experiment. Can it be as simple as just making a basic formula around sleeping times and heart rate? I build a query looking at deep sleep over 1.5 hours, heart rate under 60, and sorting by highest REM time:

Now to look at what days this gets back, and check what the sleep scores for those days was. Surprise, surprise. It's pretty much the same dates we got in the initial query. This confirms that the intuition/hypothesis was pretty much spot on and I can "predict" my sleep score with simple math

Why does this matter? You can look a simple "sleep score" and believe it's a fancy, groundbreaking AI insight. However, more often than not - it's either a reasonable & intuitive formula or maybe a basic regression. Simpler. More accurate. Cheaper to compute. Choose smart data science over trends!!