Sentiment Analysis of YouTube Comments on the KDM Policy in Handling Juvenile Delinquency Using Naïve Bayes
DOI:
https://doi.org/10.66341/fusion.v3i1.344Keywords:
sentiment analysis, YouTube, Naïve Bayes, TF-IDF, public policyAbstract
The policy of West Java Governor Dedi Mulyadi (KDM) to send troubled youths to military barracks as a form of character development to address juvenile delinquency triggered diverse public opinions in YouTube comment sections, which were difficult to analyze manually due to their large volume and linguistic variation. This study aims to analyze the sentiment of YouTube comments toward the policy using the Naïve Bayes Classifier algorithm with Term Frequency-Inverse Document Frequency (TF-IDF) weighting, and to evaluate model performance based on accuracy, precision, recall, and F1-score metrics. The research data were obtained from a public Kaggle dataset comprising 7,875 comments, which after preprocessing resulted in 7,407 valid data with a proportion of 56.6% negative and 43.4% positive comments. The data were split using an 80:20 ratio with stratified sampling. Test results show that the Naïve Bayes model achieved an accuracy of 73.95%, precision of 84.64%, recall of 48.83%, and F1-score of 61.93%, with the negative class performing better (F1-score 80%) than the positive class (F1-score 62%) due to class imbalance in the dataset. Word cloud analysis revealed that negative sentiment was largely not directed at the KDM policy itself, but rather at criticism toward the Indonesian Child Protection Commission (KPAI). This study provides an objective overview of public perception that can serve as a basis for evaluating juvenile delinquency handling policies.
References
[1] S. M. Harahap et al., “Analisis Sentimen Komentar YouTube terhadap Food Vlogger dengan Menggunakan Metode Naïve Bayes Sulistia Maharani Harahap,” vol. 9, no. 1, pp. 87–96, 2024.
[2] R. B. Aprianto, A. Eviyanti, H. Setiawan, I. Ratna, and I. Astutik, “DEDI MULYADI DENGAN METODE MACHINE LEARNING ( STUDI KASUS : KENAKALAN REMAJA ),” vol. 10, no. 2, pp. 2997–3004, 2026.
[3] M. R. Herdiansyah, A. Yuliana, T. Informatika, N. Bayes, and K. Sentimen, “NAÏVE BAYES BERDASARKAN KOMENTAR PADA YOUTUBE,” vol. 8, no. 6, pp. 12454–12459, 2024.
[4] D. Marganingsih, H. Oktavianto, and G. Abdurrahman, “Analisis Sentimen Komentar YouTube Masterchef Indonesia Menggunakan Algoritma Support Vector Machine Dan Gaussian Naïve Bayes Sentiment Analysis of YouTube Comments on Masterchef Indonesia Using Support Vector Machine and Gaussian Naïve Bayes Algorithms,” vol. 5, no. 1, pp. 16–26, 2025, doi: 10.59395/jitp.v5i1.117.
[5] N. Dwi, H. Sadikin, and S. Susanti, “Analisis Sentimen Publik Terhadap Kampanye Pengurangan Sampah Plastik Menggunakan Algoritma Naïve Bayes,” vol. 15, no. 2, pp. 202–212, 2025.
[6] Z. Fatah, M. T. Ismardani, P. Studi, S. Informasi, and U. Ibrahimy, “Analisis Sentimen Komentar Pengguna YouTube Terhadap Kebijakan Penyitaan Tanah oleh Pemerintah Menggunakan Metode Naïve Bayes Sentiment Analysis of YouTube User Comments on the Government ’ s Land Confiscation Policy Using the Naive Bayes Method,” vol. 12, no. November 2025, pp. 59–66, doi: 10.37715/juisi.v12i1.6161.
[7] A. Angdresey, L. Sitanayah, I. Lucky, and H. Tangka, “Sentiment Analysis for Political Debates on YouTube Comments using BERT Labeling , Random Oversampling , and Multinomial Naïve Bayes,” 2025.
[8] M. Monica and A. Purwanto, “Comparative Performance Evaluation of Naïve Bayes and Logistic Regression for Indonesian YouTube Comment Sentiment Classification Evaluasi Komparatif Kinerja Algoritma Naïve Bayes dan Logistic Regression dalam Klasifikasi Sentimen Komentar YouTube Berbahasa Indonesia,” vol. 6, no. April, pp. 934–943, 2026.
[9] B. Anderson, M. Irzal, and A. Hendarno, “Sentiment Analysis of Indonesia ’ s Free School Lunch Policy Using LSTM and Word2Vec on YouTube Comments,” no. 021, pp. 36–44, 2024.
[10] W. B. Zulfikar, A. R. Atmadja, and S. F. Pratama, “Sentiment Analysis on Social Media Against Public Policy Using Multinomial Naive Bayes,” vol. 10, no. 1, pp. 25–34, 2023, doi: 10.15294/sji.v10i1.39952.
[11] R. Wati, S. Ernawati, and H. Rachmi, “Pembobotan TF-IDF Menggunakan Naïve Bayes Pada Sentimen Masyarakat Mengenai Isu Kenaikan BIPIH TF-IDF Weighting Using Naïve Bayes on Public Sentiment on The Issue of Rising BIPIH,” vol. 13, no. April, pp. 84–93, 2023.
[12] F. Yudistira and A. R. Isnain, “Analisis Sentimen Terhadap Seleksi CPNS Tahun 2024 Berbasis Media Sosial X Menggunakan Algoritma Naïve Bayes Program Studi Informatika , Fakultas Teknik dan Ilmu Komputer , Universitas Teknokrat Indonesia , SENTIMENT ANALYSIS OF THE 2024 CPNS SELECTION BASED ON SOCIAL MEDIA X USING THE NAÏVE BAYES ALGORITHM,” vol. 5, no. 3, pp. 887–897, 2025.
[13] I. Najiyah and M. Rizal, “Analisis Sentimen Media Sosial X Terhadap Kebijakan Presiden Republik Indonesia Prabowo Subianto,” vol. 15, no. 3, pp. 443–455, 2025.
[14] D. P. Anggraeni, D. Rosadi, and A. A. Rizal, “Prediksi harga emas dunia di masa pandemi covid-19 menggunakan model arima,” no. January, 2021.
[15] C. H. Lin and U. Nuha, “Sentiment analysis of Indonesian datasets based on a hybrid deep learning strategy,” J. Big Data, 2023, doi: 10.1186/s40537-023-00782-9.
[16] R. Firdaus, R. Al Hariri, and H. Fu, “Sentimen Analisis Masyarakat Tentang Penetapan Hari Raya Idul Adha Tahun 2023 Pada Video YouTube Menggunakan Algoritma Random Forest dan Support Vector Machine,” vol. 14, no. 1, pp. 278–285, 2024.
[17] N. Mahfudza and M. Ikhsan, “Sentiment Analysis of YouTube Comments on Indonesian Presidential Candidates in 2024 using N aїve Bayes Classifier Method,” vol. 12, no. 2, pp. 140–148, 2025, doi: 10.30865/jurikom.v12i2.8538.
[18] A. Aliyudin, U. Siliwangi, and K. Tasikmalaya, “ANALISIS SENTIMEN TERHADAP PIALA DUNIA U-20 YANG BATAL DISELENGGARAKAN DI INDONESIA PADA MEDIA YOUTUBE DENGAN,” vol. 8, no. 2, pp. 71–78, 2023.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Muhammad Afan Adi Saputra, Wildan Arosyid, Huda Mutamam (Author)

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.










