Increased digital device usage has been associated with various mental health risks, including stress, highlighting the need for predictive approaches capable of objectively identifying digital behavior patterns. This study aims to compare the performance of Random Forest and XGBoost in classifying stress levels based on digital behavior and sleep-related features, while also examining the effects of hyperparameter optimization on the performance of both models. The study uses the Screentime vs Mental Wellness Survey 2025 dataset, comprising 400 respondents, with a class distribution of 85.2% for the "Stressed" class and 14.8% for the "Safe" class. Features suspected of acting as proxies for the target variable, namely Mental Wellness Index and Productivity, were excluded to reduce the risk of data leakage. Class balancing was performed using SMOTENC within the training pipeline, while hyperparameter optimization was conducted using GridSearchCV, with F1-Macro as the primary optimization metric. The main evaluation employed stratified 80:20 training-test splits across 21 random seeds, with F1-Macro reported as the average across all splits. Differences in model performance were analyzed using the Wilcoxon signed-rank test and the 5×2 cross-validation paired t-test. The results show that the average F1-Macro score of Random Forest increased from 0.7721 to 0.7807 following optimization, while XGBoost improved from 0.7370 to 0.7684. Random Forest achieved a higher F1-Macro score in 11 out of 21 data splits. However, neither the Wilcoxon signed-rank test (p = 0.2959) nor the 5×2 cross-validation paired t-test (p = 0.5747) revealed a statistically significant difference in model performance. Feature importance analysis indicated that screen time hours and sleep quality were the dominant features in both models. These findings are limited to the dataset used in this study, and external validation is still required to assess the generalizability of the models to other populations.
Copyrights © 2026