Perbandingan Metode Naive Bayes dan Random Forest untuk Analisis Sentimen Publik Terhadap Program Makan Bergizi Gratis Pada Sosial Media X
(Comparison of Naive Bayes and Random Forest Methods for Public Sentiment Analysis of the Free Nutritious Meals Program on Social Media X)
Khen Dedes, S.Tr.Kom., M.T. as Supervisor
Mohammad Ari Bagus Laksana
Study Program of Informatics Engineering
Majoring in Information Technology
Program Studi Teknik Informatika
Jurusan Teknologi Informasi
ABSTRACT
The development of social media has generated various public opinions that can be utilized to understand public perceptions of certain issues. One of the issues that has attracted public attention is the Free Nutritious Meals Program (MBG), which has received positive, negative, and neutral responses. This study aims to analyze public sentiment toward the Free Nutritious Meals Program based on data obtained from social media X (Twitter) and to compare the performance of the Naïve Bayes and Random Forest algorithms in sentiment classification using accuracy, precision, recall, and F1-score metrics. This study employed the Cross-Industry Standard Process for Data Mining (CRISP-DM) methodology, which consists of Business Understanding, Data Understanding, Data Preparation, Modeling, Evaluation, and Deployment stages. The dataset consisted of Indonesian-language tweets related to the Free Nutritious Meals Program, which underwent preprocessing, sentiment labeling, data splitting, and feature weighting using Term Frequency-Inverse Document Frequency (TF-IDF). The classification process was carried out using the Naïve Bayes and Random Forest algorithms with three data split scenarios, namely 90:10, 80:20, and 70:30. The results showed that public sentiment toward the Free Nutritious Meals Program consisted of positive, negative, and neutral sentiments, with positive sentiment being the most dominant. Based on the evaluation results, the Random Forest algorithm outperformed Naïve Bayes in all data split scenarios. The best performance was achieved with the 80:20 data split ratio, yielding an accuracy of 77.29%, while Naïve Bayes achieved its highest accuracy of 74.52% with the 90:10 data split ratio. Therefore, the Random Forest algorithm proved to be more effective for sentiment classification of the Free Nutritious Meals Program in this study..
Keywords: Sentiment Analysis, Free Nutritious Meals Program, Naive Bayes, Random Forest.