We use a few cookies

Essential cookies keep the library working. With your permission, we'd also like to use analytics to see what's useful and improve the experience. Read our Privacy Policy or Cookie Policy.

Skip to main content
Home/e-Resources/General Science/Mental Health Classification Using Naïve Bayes and Random Forest Algorithms
PeriodicalsGeneral Science

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

Checking your access to this record.

Abstract & Overview

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.

Cite this record

Muhammad Jazum Faisti, Raden Hadapiningradja Kusumodestoni, Gentur Wahyu Nyipto Wibowo (2025). Mental Health Classification Using Naïve Bayes and Random Forest Algorithms. Journal of Applied Informatics and Computing, 9(4), 1740–1750. https://doi.org/10.30871/jaic.v9i4.10144

Copy in another style

Faisti, M. J., Kusumodestoni, R. H., & Wibowo, G. W. N. (2025). Mental Health Classification Using Naïve Bayes and Random Forest Algorithms. Journal of Applied Informatics and Computing, 9(4), 1740–1750. https://doi.org/10.30871/jaic.v9i4.10144
Author names are used as deposited, so check their order before you submit.

Metadata is harvested from open-access indexes and can be incomplete. Check a citation against the published version before relying on it — see our open access & attribution policy.