Detection of Mental Health Tendencies Using Naïve Bayes Based on Social Media Activity

Authors

  • Jeremi Sibarani STIKOM Tunas Bangsa
  • Ratih Manalu STIKOM Tunas Bangsa
  • Dongan Parulian Hutasoit STIKOM Tunas Bangsa
  • Wilman Arif Telaumbanua STIKOM Tunas Bangsa
  • Victor Asido Elyakim P STIKOM Tunas Bangsa

DOI:

https://doi.org/10.55123/jomlai.v4i2.5959

Keywords:

Mental Health , Social Media , Naïve Bayes , Text Classification

Abstract

The development of social media has had a significant impact on individual mental health. This study aims to detect mental health trends based on user activity on social media using the Naïve Bayes algorithm. The data used is sourced from the Kaggle platform and collected through web scraping techniques with keywords related to mental health and social media activity. The analysis process includes data preprocessing, classification using Naïve Bayes, and evaluation of model performance by dividing training and test data at a ratio of 60:40, 70:30, and 80:20. The results showed that the Naïve Bayes method was able to classify mental health tendencies with the highest accuracy of 75.17% at a ratio of 60:40. Precision and recall were higher for the “Troubled” category compared to the “Good” category, showing the effectiveness of the model in detecting indications of mental disorders. However, there is still a prediction imbalance that affects the overall accuracy. These findings suggest that the Naïve Bayes algorithm can be a tool in social media-based mental health early detection, which can be used by health practitioners and researchers to design more appropriate intervention strategies.

References

A. Ilham and W. Pramusinto, ‘ANALISIS SENTIMEN MASYARAKAT TERHADAP KESEHATAN MENTAL PADA TWITTER MENGGUNAKAN ALGORITME K-NEAREST NEIGHBOR’, 2023.

A. Rosmalina and T. Khaerunnisa, ‘Penggunaan Media Sosial dalam Kesehatan Mental Remaja’, Prophetic: Professional, Empathy and Islamic Counseling Journal, vol. 4, no. 1, pp. 49–58, 2021, [Online]. Available: http://syekhnurjati.ac.id/jurnal/index.php/prophetic

M. Langgeng Wicaksono and D. Apriana, ‘ANALISIS SENTIMEN KESEHATAN MENTAL MENGGUNAKAN K-NEAREST NEIGHBORS PADA SOSIAL MEDIA TWITTER’, 2022.

M. Phangadi, ‘Peningkatan pengidap penyakit mental pada generasi Z periode 2013-2018’, 2019, Accessed: Mar. 18, 2025. [Online]. Available: https://osf.io/preprints/inarxiv/p6ms3/

S. Ardiansyah et al., KESEHATAN MENTAL. [Online]. Available: www.globaleksekutifteknologi.co.id

F. Arrahmi Thahir, F. Adisti Hajarini, K. Nasution, T. Nazira Harahap, and V. Wulandari, ‘KESEHATAN MENTAL DI ERA GENERASI Z DALAM STUDI KASUS SMP NEGERI 36 MEDAN’, JMA), vol. 1, no. 1, 2023.

American Psychological Association, ‘Stress in America, United States, 2007-2018’, 2025, Accessed: Mar. 28, 2025. [Online]. Available: https://www.icpsr.umich.edu/web/RCMD/studies/37288/versions/V2/publications

Z. N. Rudianto, ‘PENGETAHUAN GENERASI Z TENTANG LITERASI KESEHATAN DAN KESADARAN MENTAL DI MASA PANDEMI’, 2022.

A. J.-T. B. J. of Psychiatry and undefined 2000, ‘Mental health literacy: Public knowledge and beliefs about mental disorders’, cambridge.org, doi: 10.1192/bjp.177.5.396.

‘Rachmayani: Studi awal: Gambaran literasi kesehatan... - Google Scholar’. Accessed: Mar. 28, 2025. [Online]. Available: https://scholar.google.com/scholar?cluster=676048393426094152&hl=en&oi=scholarr

UNICEF - United Nations Children’s Fund, ‘The State of the World’s Children 2021: On My Mind--Promoting, Protecting and Caring for Children’s Mental Health.’, UNICEF, Oct. 2021.

A. Rizkiah, R. D. Risanty, and R. Mujiastuti, ‘SISTEM PENDETEKSI DINI KESEHATAN MENTAL EMOSIONAL ANAK USIA 4-17 TAHUN MENGGUNAKAN METODE FORWARD CHAINING’. [Online]. Available: https://jurnal.umj.ac.id/index.php/just-

Y. Femilia Nugraini, R. Rohmat Saedudin, and R. Andreswari, ‘IMPLEMENTASI DATA MINING DALAM KASUS MENTAL HEALTH PADA SOSIAL MEDIA TWITTER MENGGUNAKAN METODE NAIVE BAYES’.

H. Simorangkir and K. M. Lhaksmana, ‘Analisis Sentimen pada Twitter untuk Games Online Mobile Legends dan Arena of Valor dengan Metode Naïve Bayes Classifier’. [Online]. Available: https://dev.twitter.com.

L. Aji Andika and P. Amalia Nur Azizah, ‘Analisis Sentimen Masyarakat terhadap Hasil Quick Count Pemilihan Presiden Indonesia 2019 pada Media Sosial Twitter Menggunakan Metode Naive Bayes Classifier’, 2019.

E. Malfasari et al., ‘KONDISI MENTAL EMOSONAL PADA REMAJA’.

H. Li and J. Li, ‘Research and Application of University English Writing Teaching Reform Based on Data Mining’, Journal of Cases on Information Technology, vol. 26, no. 1, 2024, doi: 10.4018/JCIT.347667.

M. R. Firdaus, N. Rahaningsih, and R. D. Dana, ‘Analisis Sentimen Aplikasi Shopee di Goole Play Store Menggunakan Klasifikasi Algoritma Naïve Bayes’, 2024.

E. Pane, … R. H.-Zona. J. S., and undefined 2024, ‘SISTEM PENILAIAN UJIAN ESAI SECARA OTOMATIS DENGAN ALGORITMA TEXT MINING COSINE SIMILARITY PENUNJANG PEMBELAJARAN’, pustaka-psm.unilak.ac.idES Pane, R Hardianto, W ChoriahZONAsi: Jurnal Sistem Informasi, 2024•pustaka-psm.unilak.ac.id, Accessed: Mar. 28, 2025. [Online]. Available: https://pustaka-psm.unilak.ac.id/index.php/zn/article/view/20539

F. Fridom Mailo et al., ‘Analisis Sentimen Data Twitter Menggunakan Metode Text Mining Tentang Masalah Obesitas di Indonesia’, 2021.

D. Surya Sayogo, B. Irawan, and A. Bahtiar, ‘ANALISIS SENTIMEN ULASAN INSTAGRAM DI GOOGLE PLAY STORE MENGGUNAKAN ALGORITMA NAÏVE BAYES’, 2023.

J. Multidisiplin Saintek, Y. Candra Pratama, and Z. Reno Saputra, ‘SISTEM INFORMASI DESA DELTA UPANG BERBASIS WEB’, vol. 2, no. 12, pp. 86–96, 2024, [Online]. Available: https://ejournal.warunayama.org/kohesi

A. Yoga Pratama et al., ‘Analisis Sentimen Media Sosial Twitter Dengan Algoritma K-Nearest Neighbor Dan Seleksi Fitur Chi-Square (Kasus Omnibus Law Cipta Kerja)’, 2021.

H. Schütze, C. Manning, and P. Raghavan, ‘Introduction to information retrieval’, 2008, Accessed: Mar. 28, 2025. [Online]. Available: https://www.cis.uni-muenchen.de/~hs/teach/14s/ir/pdf/19web.pdf

I. R.-I. 2001 workshop on empirical methods in artificial and undefined 2001, ‘An empirical study of the naive Bayes classifier’, dors.itI RishIJCAI 2001 workshop on empirical methods in artificial intelligence, 2001•dors.it, Accessed: Mar. 28, 2025. [Online]. Available: https://www.dors.it/documentazione/testo/201911/10.1.1.330.2788.pdf

H. Z.- Aa and undefined 2004, ‘The optimality of naive Bayes’, cdn.aaai.org, Accessed: Mar. 28, 2025. [Online]. Available: https://cdn.aaai.org/FLAIRS/2004/Flairs04-097.pdf

A. McCallum, K. N.-A.-98 workshop on learning for, and undefined 1998, ‘A comparison of event models for naive bayes text classification’, yangli-feasibility.comA McCallum, K NigamAAAI-98 workshop on learning for text categorization, 1998•yangli-feasibility.com, Accessed: Mar. 28, 2025. [Online]. Available: http://yangli-feasibility.com/home/classes/lfd2022fall/media/aaaiws98.pdf

F. Dwi Astuti et al., ‘Sentimen Analisis Review Pengguna Marketplace Online Menggunakan Naïve Bayes Classifier’, core.ac.ukS Rahayu, K Kusrini, H SismoroInformasi Interaktif, 2018•core.ac.uk, 2018, Accessed: Mar. 28, 2025. [Online]. Available: https://core.ac.uk/download/pdf/231289869.pdf

Downloads

Published

2025-06-20

How to Cite

Jeremi Sibarani, Ratih Manalu, Dongan Parulian Hutasoit, Wilman Arif Telaumbanua, & Victor Asido Elyakim P. (2025). Detection of Mental Health Tendencies Using Naïve Bayes Based on Social Media Activity. JOMLAI: Journal of Machine Learning and Artificial Intelligence, 4(2), 80–87. https://doi.org/10.55123/jomlai.v4i2.5959

Issue

Section

Articles