Sleep health and lifestyle · 374 people · synthetic data

Sleep Disorder Analysis

Who has insomnia or sleep apnea, how their sleep and health differ, and how well a Decision Tree predicts it. Project on GitHub

Sleep disorder by group

Share of people in each group with no disorder, insomnia or sleep apnea

Sleep and health by disorder

Averages for each group

Stress and sleep

Average hours of sleep at each stress level (1–10); hover for sleep quality and group size

Model accuracy, tested three ways

Decision Tree predicting None / Insomnia / Sleep apnea (full dataset)

Original split: the notebook's random 80/20 split. 66 of its 75 test rows also appear in training, because 242 of 374 rows repeat another person's exact profile.

Leak-free: identical profiles kept together, so the model is always tested on profiles it has not seen. The score holds at about 89%.

Unique profiles: each distinct profile counted once. The common, repeated profiles are the easy ones.

What the model relies on

Decision Tree feature importance

Confusion matrix, original test set

Data: Sleep Health and Lifestyle Dataset (Kaggle), a synthetic dataset. Patterns describe how the data was generated, not medical cause and effect. Built by scripts/build.py.