We use the dataset from Baigutanova, A. et al. Research Question: Does continuous daytime sensor data improve the prediction of depression (PHQ9) and anxiety (GAD7) scores compared to a baseline model using only sleep diaries and participant surveys?
The dataset combines multimodal data from 49 participants over four weeks, located in the data folder.
- Surveys (
survey.csv): Participant demographics, lifestyle habits, and biweekly clinical scores (PHQ9, GAD7, ISI). - Sleep Diaries (
sleep_diary.csv): Daily self-reported sleep metrics likesleep_duration,sleep_efficiency, andsleep_latency. - Processed Sensor Data (
sensor_hrv_filtered.csv): 5-minute daytime aggregates of physiological (HR, HRV), motion (steps), and environmental (light) data. - Raw Sensor Data (
raw_data/): High-frequency (10 Hz) time-series signals from the smartwatch sensors.
Our analysis is a retrospective comparison of three machine learning models to isolate the predictive value of passive sensor data.
-
Data Ingestion:
- Merge survey, sleep, and processed sensor data tables.
- Aggregate daily and 5-minute data to align with biweekly PHQ9/GAD7 scores.
-
Feature Engineering:
- Extract static features (demographics, lifestyle).
- Engineer aggregate sleep features from diaries (e.g.,
mean_sleep_duration). - Engineer aggregate sensor features from daytime data (e.g.,
mean_daytime_rmssd).
-
Comparative Modeling:
- Train and evaluate three models using cross-validation:
- Baseline Model: Static + Sleep Features
- Sensor-Only Model: Static + Sensor Features
- Combined Model: Static + Sleep + Sensor Features
- Train and evaluate three models using cross-validation:
The final analysis is implemented as an interactive marimo notebook located at src/notebooks/final_model_notebook.py.
- Python >= 3.10
- Install dependencies using uv:
uv syncTo launch the interactive notebook:
uv run marimo run src/notebooks/final_model_notebook.pyTo edit the notebook in the marimo editor:
uv run marimo edit src/notebooks/final_model_notebook.pyThe notebook provides interactive controls for:
- Exploring the dataset (surveys, sleep diaries, sensor data)
- Configuring UMAP dimensionality reduction parameters
- Adjusting regularization strength for Ridge/Lasso models
- Visualizing predicted vs actual scores
- Viewing patient-level time series trends