Mental health disorders like depression, anxiety, and stress (DAS) are rising globally. Understanding how diet and lifestyle influence these conditions is vital for targeted interventions. This study explores the potential of machine learning (ML) to identify key risk factors and improve mental health predictions in adult males. This cross-sectional study gathered dietary data from 400 adult males using the Food Frequency Questionnaire (FFQ). The dataset contained 59 predictor variables, and DAS was classified as either normal or indicative of some degree of disorder. The predictive performance of five ML models [bagging, boosting, Naive Bayes (NB), support vector machine (SVM), and random forest (RF)] was assessed using cross-validation. Metrics such as sensitivity, specificity, precision (positive predictive value, PPV), negative predictive value (NPV), accuracy, and the area under the curve (AUC) were used to evaluate performance. DAS were present in 103 (25.47%) of participants. Bagging, boosting, and RF models outperformed others, achieving over 70% in all metrics. Key prognostic factors for predicting DAS include fried fast food, physical activity (PA), body mass index (BMI), magnesium, sodium, and other dietary elements like butter/margarine, fructose, and vitamin K. Chromium and caffeine were significant predictors of depression and anxiety, while cholesterol and olive oil were strongly associated with stress. The study shows that the RF, boosting, and bagging algorithms outperformed other models in predicting DAS across all evaluation criteria. Key dietary and lifestyle factors, such as magnesium, sodium, BMI, caffeine, and cholesterol, were identified as significant predictors, highlighting the potential of ML for advancing targeted mental health interventions.
Practical Application: This study highlights the effectiveness of machine learning algorithms in predicting mental health issues such as stress, anxiety, and depression by analyzing dietary patterns, lifestyle choices, and clinical parameters. The results provide valuable insights for healthcare professionals and policymakers in creating targeted dietary and lifestyle interventions to improve mental health outcomes. In addition, these findings have important implications for the food and nutrition industry, potentially guiding the development of specialized nutritional products aimed at enhancing mental well-being.