RESUMO
Stress is a psychological condition resulting from the body's response to challenging situations, which can negatively impact physical and mental health if experienced over prolonged periods. Early detection of stress is crucial to prevent chronic health problems. Wearable sensors offer an effective solution for continuous and real-time stress monitoring due to their non-intrusive nature and ability to monitor vital signs, e.g., heart rate and activity. Typically, most existing research has focused on data collected in controlled environments. Yet, our study aims to propose a machine learning-based approach for detecting stress in a free-living environment using wearable sensors. We utilized the SWEET dataset, which includes data from 240 subjects collected via electrocardiography (ECG), skin temperature (ST), and skin conductance (SC). We assessed four machine learning models, i.e., K-Nearest Neighbors (KNN), Support Vector Classification (SVC), Decision Tree (DT), Random Forest (RF), and XGBoost (XGB) in four different settings. This study evaluates the performance of various machine learning models for stress classification using the SWEET dataset. The analysis included two binary classification scenarios (with and without SMOTE) and two multi-class classification scenarios (with and without SMOTE). The Random Forest model demonstrated superior performance in the binary classification without SMOTE, achieving an accuracy of 98.29 % and an F1-score of 97.89 %. For binary classification with SMOTE, the K-Nearest Neighbors model performed best, with an accuracy of 95.70 % and an F1-score of 95.70 %. In the three-level classification without SMOTE, the Random Forest model again excelled, achieving an accuracy of 97.98 % and an F1-score of 97.22 %. For three-level classification with SMOTE, XGBoost showed the highest performance, with an accuracy and F1-score of 98.98 %. These results highlight the effectiveness of different models under various conditions, emphasizing the importance of model selection and preprocessing techniques in enhancing classification performance.