← Back to Projects

MACHINE LEARNING · DATA ANALYSIS · RESEARCH

Personal Wellness

A machine-learning study investigating how lifestyle and behavioral variables relate to sleep quality, sleep duration, and stress.

15K+ records R² 0.796 Sleep Quality R² 0.814 Stress

Research Question

The project investigated whether modern lifestyle variables such as screen time, phone usage before sleep, caffeine intake, occupation, and demographic factors could be used to model sleep and stress outcomes.

Dataset & Preprocessing

The analysis used a publicly available dataset containing more than 15,000 lifestyle and behavioral records.

Numerical and categorical variables were processed separately. Categorical features were one-hot encoded, numerical features were standardized, and fallback imputation was incorporated into the preprocessing pipeline.

Data was divided into training and testing sets using an 80/20 split with a fixed random state for reproducibility.

Models

Linear Regression was used as a baseline model, while a Decision Tree was used to capture potential non-linear relationships between behavioral features and target variables.

Five-fold cross-validation and grid-search hyperparameter tuning were used to evaluate model stability and improve generalization.

Results

The original attempt to predict sleep duration performed poorly, with Linear Regression producing an R² value near zero.

The analysis was then refined toward sleep quality and stress. The Decision Tree achieved an R² of approximately 0.796 for sleep quality and 0.814 for stress prediction.

What I Learned

One of the most valuable outcomes of the project was learning that unsuccessful models can still provide useful information. The poor sleep-duration baseline prompted a reevaluation of the target variable rather than forcing an unsupported conclusion from the data.