Smart Campus Analytics for Machine Learning Approaches to Student Stress, Anxiety, and Depression Prediction
Keywords:
student depression prediction, Particle Swarm Optimization, K Nearest Neighbors, metaheuristic optimization, regression and classificationAbstract
Accurate prediction of student depression levels is a critical challenge in educational analytics, requiring models capable of capturing nonlinear relationships among demographic, behavioral, and academic features. This study evaluates the performance of the Particle Swarm Optimization (PSO) algorithm when integrated into a K‑Nearest Neighbors (KNN) framework for regression and classification tasks. Using a student mental health dataset enriched with attributes such as sleep duration, screen time, physical activity, CGPA, and attendance, the models were optimized and benchmarked against a baseline KNN. Experiments conducted in Google Colab assessed predictive accuracy using Mean Squared Error (MSE), Coefficient of Determination (R²), and classification metrics including Confusion Matrix, Precision, Recall, and F1‑score. Results show that the baseline KNN achieved an accuracy of 61%, MSE of 7.86, and R² of 0.66, reflecting moderate predictive capability. The KNN‑PSO model, optimized to , improved accuracy to 64%, reduced MSE to 7.40, and increased R² to 0.68, demonstrating enhanced stability and explanatory power. These findings confirm that metaheuristic‑driven optimization strengthens the robustness of KNN models, yielding more reliable predictions across depression severity levels. The study contributes to bridging the gap in comparative evaluations of PSO‑based optimization for student mental health analytics, offering practical insights into the trade‑off between exploration and exploitation strategies for reliable predictive modeling.







