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.
Copyrights © 2025