JOURNAL OF APPLIED INFORMATICS AND COMPUTING
Vol. 9 No. 4 (2025): August 2025

Mental Health Classification Using Naïve Bayes and Random Forest Algorithms

Faisti, Muhammad Jazum (Unknown)
Kusumodestoni, R. Hadapiningradja (Unknown)
Wibowo, Gentur Wahyu Nyipto (Unknown)



Article Info

Publish Date
08 Aug 2025

Abstract

Mental health is a crucial issue affecting individual and societal well-being. This study aims to investigate and compare the performance of Machine Learning algorithms, namely Naïve Bayes and Random Forest, for text-based mental health classification. The dataset used is the Mental Health Corpus from Kaggle, consisting of 27,977 English text messages from online forums, with binary labels (0: no indication of mental disorder, 1: indication of mental disorder) pre-annotated by the dataset creators. Text preprocessing involved lowercasing, negation handling, stopword removal, slang normalization, tokenization, and stemming. Data transformation was performed using TF-IDF. Model evaluation utilized accuracy, precision, recall, and F1-score metrics, along with 5-Fold Cross Validation. Evaluation results indicate high performance for both algorithms. Naïve Bayes achieved 88.7 % accuracy, 84.2 % precision, 95.2 % recall, and 89.3 % F1-score on the test data. Random Forest demonstrated more balanced performance with 89.3 % accuracy, 88.1 % precision, 90.5 % recall, and 89.3 % F1-score. The 5-Fold Cross Validation for Naïve Bayes yielded average scores of 88.8 % accuracy, 84.4 % precision, 94.9 % recall, and 89.3 % F1-score. In contrast, Random Forest showed averages of 89.2 % accuracy, 88.8 % precision, 89.5 % recall, and 89.3 % F1-score. While Naïve Bayes had higher recall, Random Forest exhibited the best overall performance, considering the combination of accuracy, precision, and stable generalization, making it more effective for mental health text classification.

Copyrights © 2025






Journal Info

Abbrev

JAIC

Publisher

Subject

Computer Science & IT

Description

Journal of Applied Informatics and Computing (JAIC) Volume 2, Nomor 1, Juli 2018. Berisi tulisan yang diangkat dari hasil penelitian di bidang Teknologi Informatika dan Komputer Terapan dengan e-ISSN: 2548-9828. Terdapat 3 artikel yang telah ditelaah secara substansial oleh tim editorial dan ...