Student Mental Health Risk Classification Using Random Forest and BERTopic: A Tabular and Text Analysis Approach

  • Fairuz Arya Bagus Pramana Arya Military Mathematic Student, FMIPA, Indonesian Defense University, Bogor
  • Rumadi Rumadi Research Center For Data And Information Sains, Badan Riset Dan Informasi Nasional
  • Dian Anggraini Military Mathematic Lecturer, FMIPA, Indonesian Defense University, Bogor
Keywords: Random Forest; BERTopic; Mental Health

Abstract

Student mental health has become a critical issue affecting academic performance and quality of life. Many previous studies have only used numerical data and have not explored textual data that reflects students' subjective conditions. This study develops a classification model using Random Forest on tabular data to predict the risk of student mental health issues. The dataset consists of 500 students with a training-to-testing data split of 80:20. The model uses features such as academic performance, sleep patterns, and psychological scores. The results show that the model achieves a macro F1 Score of 0.90 despite class imbalance. The most influential variables are depression scores, stress levels, and anxiety. In addition, the BERTopic method was used separately to analyze text data and identify thematic patterns from student responses. However, not all topics generated were directly related to mental health. The model also has limitations in detecting minority classes due to data imbalance. This study provides a classification approach supported by text analysis to comprehensively understand students' mental health conditions.

References

Figueira, G. M., Demarchi, M. E., Casselli, D. D. N., Silva, E. de S. M. e, & Souza, J. C. (2020). Fatores de risco associados ao desenvolvimento de transtornos mentais em estudantes universitários. Research, Society and Development, 9(9), e432997454. https://doi.org/10.33448/rsd-v9i9.7454
Gao, X., & Sazara, C. (2023). Discovering Mental Health Research Topics with Topic Modeling. http://arxiv.org/abs/2308.13569
George, L., & Sumathy, P. (2023). An integrated clustering and BERT framework for improved topic modeling. International Journal of Information Technology (Singapore), 15(4), 2187–2195. https://doi.org/10.1007/s41870-023-01268-w
Liao, S., Zhang, Q., & Gan, R. (2021). Construction of real-time mental health early warning system based on machine learning. Journal of Physics: Conference Series, 1812(1). https://doi.org/10.1088/1742-6596/1812/1/012032
Liu, L., Tang, L., Dong, W., Yao, S., & Zhou, W. (2016). An overview of topic modeling and its current applications in bioinformatics. In SpringerPlus (Vol. 5, Number 1). SpringerOpen. https://doi.org/10.1186/s40064-016-3252-8
Mersha, M. A., yigezu, M. G., & Kalita, J. (2024). Semantic-Driven Topic Modeling Using Transformer-Based Embeddings and Clustering Algorithms. http://arxiv.org/abs/2410.00134
Mohana, R. M., Reddy, C. K. K., Anisha, P. R., & Murthy, B. V. R. (2021). WITHDRAWN: Random forest algorithms for the classification of tree-based ensemble. Materials Today: Proceedings. https://doi.org/10.1016/j.matpr.2021.01.788
Russ, T. C., Woelbert, E., Davis, K. A. S., Hafferty, J. D., Ibrahim, Z., Inkster, B., John, A., Lee, W., Maxwell, M., McIntosh, A. M., Stewart, R., Anderson, M., Aylett, K., Bourke, S., Burhouse, A., Callard, F., Chapman, K., Cowley, M., Cusack, J., … Zammit, S. (2019). How data science can advance mental health research. Nature Human Behaviour, 3(1), 24–32. https://doi.org/10.1038/s41562-018-0470-9
Sakthi Vel, S. (2021). Pre-Processing techniques of Text Mining using Computational Linguistics and Python Libraries. Proceedings - International Conference on Artificial Intelligence and Smart Systems, ICAIS 2021, 879–884. https://doi.org/10.1109/ICAIS50930.2021.9395924
Saraswat, P., & Raj, S. (2022). DATA PRE-PROCESSING TECHNIQUES IN DATA MINING: A REVIEW. International Journal of Innovative Research in Computer Science & Technology, 122–125. https://doi.org/10.55524/ijircst.2022.10.1.22
Tadesse, M. M., Lin, H., Xu, B., & Yang, L. (2019). Detection of depression-related posts in reddit social media forum. IEEE Access, 7, 44883–44893. https://doi.org/10.1109/ACCESS.2019.2909180
Tajima, K., Ichijo, N., Nakahara, Y., & Matsushima, T. (2024). An Algorithmic Framework for Constructing Multiple Decision Trees by Evaluating Their Combination Performance Throughout the Construction Process. http://arxiv.org/abs/2402.06452
Tiwari, V., Garg, B., & Sharma, U. P. (2020). Significant Impact of Improved Machine Learning Algorithm in The Processes of Large Data Sets. International Journal of Scientific Research in Computer Science, Engineering and Information Technology, 458–467. https://doi.org/10.32628/cseit206133
Xu, Bing., & Mou, Kefen. (2020). Proceedings of 2020 IEEE 4th Information Technology, Networking, Electronic and Automation Control Conference (ITNEC 2020) : June 12-14, 2020, Chongqing, China. IEEE Press.
Zhang, X., & milios, E. (2023). MPTopic: Improving topic modeling via Masked Permuted pre-training. http://arxiv.org/abs/2309.01015
Ziya (2025). Student Mental Health Survey [Dataset]. Kaggle. https://www.kaggle.com/datasets/ziya07/student-mental-health-and-resilience-dataset
Published
2026-09-22