DOI: 10.11648/j.ijpbs.20261102.12 ISSN: 2575-1573

A Transparent AI-Driven Ensemble Learning Approach for Predicting Mental Health Risks among University Students in Kenya

Victor Lumumba, Dennis Muriithi, Monica Oundo
This study addresses the escalating mental health crisis among university students in Kenya, where psychological distress, driven by academic, financial, social, and transitional pressures, is increasingly prevalent yet under-prioritized in public health discourse. While global studies report distress rates exceeding 75% and Kenyan prevalence exceeds 40%, there remains a critical lack of localized, data-driven models to enable early detection in sub-Saharan African university settings. To address this gap, we developed transparent ensemble machine learning models, Random Forest (RF) and Extreme Gradient Boosting (XGBoost), to predict mental health distress levels (low, moderate, high) among 1,128 students across universities in Tharaka Nithi County, Kenya. Using a structured questionnaire incorporating demographic, academic, financial, psychosocial, and Quarter-Life Crisis (QLC) factors, we trained the models on 70% of the data and evaluated them on the remaining 30%. Both models achieved high performance: RF and XGBoost attained 98.8% accuracy (95% CI: 96.9–99.7%), Cohen’s Kappa of 0.978, and multi-class AUCs of 1.000 (RF) and ≥0.997 (XGBoost). Class-specific metrics revealed near-perfect precision, recall, and F1-scores; for high distress, both models achieved 100% sensitivity and specificity, with F1-scores of 1.000 (RF) and 0.988 (XGBoost). SHAP and feature importance analyses identified “Quarter-Life Crisis,” faculty of study (especially Science, Technology, Nursing, and Engineering), personal/mental health history, financial stress, and residence as top predictors. These findings support the use of interpretable AI for equitable, early-risk screening. However, careful attention must be paid to ethical considerations, including data privacy, potential algorithmic bias, and mental health stigma. We recommend integrating such models into university wellness platforms to enable proactive, targeted support for at-risk students.

More from our Archive