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/Computer Science & Information Technology/Evaluasi Algoritma KNN dan Naive Bayes untuk Analisis Sentimen Kebijakan Program Makan Bergizi Gratis
PeriodicalsComputer Science & Information Technology

Evaluasi Algoritma KNN dan Naive Bayes untuk Analisis Sentimen Kebijakan Program Makan Bergizi Gratis

Checking your access to this record.

Abstract & Overview

Social media has become a primary platform for the public to express opinions on government policies, including Indonesia’s Free Nutritious Meal (MBG) program. This study analyzes public sentiment toward MBG by comparing the K-Nearest Neighbor (KNN) and Naive Bayes algorithms. A total of 9,723 tweets were collected, and after removing the neutral category, 6,322 tweets remained (3,955 positive and 2,367 negative), indicating a dominance of positive opinions. The experimental results show that KNN performed best at k=9 with a 70:30 split, achieving an accuracy of 72.27% and an F1-score of 65.92%, with an average cross-validation accuracy of 73.30%. Naive Bayes with parameter α=0.5 consistently outperformed KNN, achieving an average accuracy of 79.61% and an F1-score of 77.33%, along with better precision–recall balance. The main contribution of this research is providing empirical evidence that Naive Bayes is more effective than KNN for sentiment analysis of Indonesian-language text with a large dataset, as well as offering a methodological framework applicable to the evaluation of other public policies.Media sosial menjadi ruang utama masyarakat untuk mengekspresikan opini terhadap kebijakan publik, termasuk Program Makan Bergizi Gratis (MBG) di Indonesia. Penelitian ini menganalisis sentimen publik terhadap MBG dengan membandingkan algoritma K-Nearest Neighbor (KNN) dan Naive Bayes. Data diperoleh dari 9.723 tweet, kemudian setelah penghapusan kategori netral tersisa 6.322 tweet (3.955 positif dan 2.367 negatif), yang menunjukkan dominasi opini positif. Hasil eksperimen menunjukkan bahwa KNN terbaik pada k=9 dengan rasio 70:30 menghasilkan akurasi 72,27% dan F1-score 65,92%, dengan akurasi rata-rata cross-validation 73,30%. Naive Bayes dengan parameter α=0,5 unggul dengan akurasi rata-rata 79,61% dan F1-score 77,33%, serta keseimbangan presisi dan recall yang lebih baik. Kontribusi penelitian ini adalah memberikan bukti empiris bahwa Naive Bayes lebih efektif dibandingkan KNN dalam analisis sentimen teks berbahasa Indonesia dengan dataset besar, serta menawarkan kerangka metodologis yang dapat diterapkan untuk evaluasi kebijakan publik lainnya.

Cite this record

Nur Sakina, Farid Wajidi, Muh. Rafli Rasyid (2025). Evaluasi Algoritma KNN dan Naive Bayes untuk Analisis Sentimen Kebijakan Program Makan Bergizi Gratis. Jambura Journal of Informatics, 1(2), 83–97. https://doi.org/10.37905/jji.v1i2.34418

Copy in another style

Sakina, N., Wajidi, F., & Rasyid, M. R. (2025). Evaluasi Algoritma KNN dan Naive Bayes untuk Analisis Sentimen Kebijakan Program Makan Bergizi Gratis. Jambura Journal of Informatics, 1(2), 83–97. https://doi.org/10.37905/jji.v1i2.34418
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.