Discovering Deeper Health Insights Through My Smartwatch Data
Many people use smart gadgets—like smartwatches—to track their physical activity, heart rate, stress levels, and sleep. While the apps that come with these watches have helpful dashboards, they often don’t reveal the full story hidden in the thousands of data points. In this article, I dive into my own data to uncover meaningful patterns and insights.
My Data Source
In 2022, I purchased the Garmin Venu 2 Plus smartwatch. I was drawn by its accurate sensors and impressive battery life. Over two years of consistent use, the device has collected comprehensive data on my daily heart rate, sleep, stress, activity levels, respiration, blood oxygen levels, and more. So far, it has tracked over 6.5 million steps and more than 5,100 kilometers of walking.
As a data scientist, I wanted to go beyond the app’s visualizations. I focused my analysis on two key questions:
1. How can I improve the quality and consistency of my sleep?
2. What factors influence how many calories I burn while doing various activities?
Using Python and libraries like Pandas, Matplotlib, Seaborn, Scikit-learn, and XGBoost, I explored and modeled my sleep health data to find answers.
Exploring Sleep Patterns
My smartwatch categorizes sleep quality into four groups: Excellent, Good, Fair, and Poor. To understand what contributes to better sleep, I began by comparing these labels to key sleep health metrics.

More Sleep -> Better Quality
A clear pattern emerged: longer sleep was associated with better quality. On average, nights rated as Good or Excellent lasted around 8 hours, while Poor nights were notably shorter.
Earlier Bedtime -> Better Sleep
There was a weaker, yet noticeable trend linking earlier bedtimes to better sleep. Fair or Poor nights were more common following later bedtimes.
Wake Time vs. Quality
Interestingly, wake-up time didn’t show a consistent relationship with sleep quality in my data.
Consistent, Moderate Physical Activity -> Better Sleep
Recognizing that restorative sleep is important, I investigated how stress and resting heart rate (RHR) affect sleep. A lower RHR during sleep was strongly associated with better quality, prompting me to explore how my daily stress and activity levels influenced RHR.

I found that on days when I had a higher maximum heart rate, burned more calories, and got more than ~4,500 steps more often led to Good or Excellent sleep scores.
While correlation does not conclude causation, the data hints that consistent, moderately intense physical activity may support better sleep.



More Intense Physical Activity -> More Calorie Burn
Next, I analyzed calorie burn by activity type. By grouping workouts and calculating calories burned per minute, I estimated the relative intensity of each activity:
- Running – 7.50 Calories/Minute (Highest)
- Indoor Cycling – 6.28
- Treadmill Running – 6.15
- Strength Training – 6.10
- 5. Walking – 4.85 (Lowest)

These results were as expected. After making more Calories vs. Avg Heart Rate plots, the patterns confirmed that higher heart rates led to more calories burned. Activities like running and strength training led to higher average heart rates and calorie burn rates compared to walking.
Higher Stress Levels -> Poor Sleep
I looked at how daily stress levels affected sleep the following night. I found a consistent trend: higher stress levels—particularly time spent in Medium or High stress—were followed by lower sleep scores and fewer hours of sleep.
Interestingly, I didn’t find a strong same-day link between physical activity and stress scores. This suggests that other factors, such as work or life events, affect stress levels more. Good sleep and regular exercise still helps with managing stress.

Days with more time in the Rest state were associated with improved sleep quality and duration the next night—another signal that recovery and stress management support better sleep health.


Calendar Trends
I also examined trends by day of the week and by month. Analysis didn’t reveal strong differences in sleep quality across days. However, sleep quality slightly improved in the late summer months (August and September). This may mean be due to seasonal lifestyle factors.


Predicting Sleep Quality with Machine Learning
Finally, I applied machine learning techniques to see if I could predict my sleep quality (Poor, Fair, Good, or Excellent) based on the physical activity, stress, and heart rate data from the day before. For this, I tested several algorithms, including Random Forest, XGBoost, and Logistic Regression, using a pipeline that handled data imputation (filling missing values), scaling (standardizing ranges), and class imbalance (using SMOTE to oversample rarer categories). I fed the models data for 39 different metrics, including heart rate from exercise, stress levels, total steps, other activity metrics, and more.
The results showed that the Random Forest model achieved the highest accuracy on the test data, correctly predicting my sleep quality category about 55.6% of the time. The model did particularly well on predicting the ‘Fair’ (61% F1-score) and ‘Good’ (67% F1-score) categories. But this model and also the other ones struggled with predicting the rarer ‘Poor’ (38% F1-score) and especially the ‘Excellent’ (0% F1-score) sleep categories. This is expected, as these extreme ratings only appeared in my data a few times.
To understand what factors the model found were most important for making predictions, I dug deeper into the Random Forest model. As of April 20, 2025, the top 3 most important factors were:
- Length of Low Stress Periods
- Length of Rest
- Average Daily Stress Score
This suggests that stress-related data were key indicators of my sleep quality according to the model. Other factors in the top 15 included maximum heart rate during exercise (especially Strength Training and overall physical activity), breathing rate, differences in heart rate, blood oxygen levels, and calorie burn. This matches with my earlier findings as mentioned.
Conclusion
To sleep better, my data suggest it’s important to go to bed earlier, sleep more hours, exercise regularly, and manage stress. In short, healthy routines during the day lead to better nights.
Explore Further and Share Your Insights
If you’d like to explore the full code, analyze your own data, or build on this project, feel free to visit the GitHub repository.
You’re welcome to try it with your own dataset. I’d be glad to hear about your findings and experience. Let’s take care of our health by sleep better!
Support Green Schools Green Future
My project shows how data and technology can empower us to make positive changes. At Green Schools Green Future (GSGF), we are harnessing technology and hands-on learning to build a sustainable future. We’ve developed a new, progressive model of green education.
Our schools will turn students into green leaders, connecting them with sustainable tools, technology (like AI, blockchain, and green energy systems), and practical skills for the new green economy. We need your support bring our vision to life.
• Donate: Help us build our first pilot green school! Your contribution funds sustainable materials, solar panels, vertical farms, and more. Give students the hands-on, future-ready skills they need.
• Volunteer: Join our dedicated team! GSGF relies on the passion and expertise of volunteers to help develop our programs, support outreach, and advance our mission. Share your time and skills to make a difference.
• Stay Informed: Learn more about our unique approach to sustainable education and keep up with our progress.