Comparison of Naïve Bayes and K-Nearest Neighbor for Iphone 16 Youtube Sentiment
DOI:
https://doi.org/10.58776/ijitcsa.v4i2.210Keywords:
Sentiment Analysis, Iphone 16, Naïve Bayes, K-Nearest NeighborAbstract
Sentiment analysis plays an important role in understanding public opinion toward technological products, particularly in the context of social media such as YouTube. This study aims to analyze the sentiment of user comments on an iPhone 16 review video published by the GadgetIn YouTube channel, as well as to compare the performance of the Naïve Bayes and K-Nearest Neighbor classification algorithms. The data were collected through a crawling process, resulting in 2,499 comments, which were then split into training data 80% and testing data 20%. The methodology includes text cleaning, tokenization, normalization, and term weighting using the TF-IDF method. The experimental results show that the Naïve Bayes algorithm achieved an accuracy of 73%, with precision, recall, and F1-score each reaching 72%, outperforming KNN, which only achieved 65% accuracy. Most comments were neutral; positive comments generally focused on design and performance, while negative comments mainly highlighted price and comparisons with other products. These findings indicate that the Naïve Bayes algorithm is more suitable for sentiment analysis of unstructured YouTube comment data.
References
A. Z. Yonatan, “Indonesia Masuk Jajaran Pengguna YouTube Terbanyak di Dunia 2025,” GoodStats. [Online]. Available: https://goodstats.id/article/indonesia-masuk-jajaran-pengguna-youtube-terbanyak-di-dunia-2025-7Cvdz
S. N. S. Muslim, F. Nurdiansyah, and Aviv Yuniar Rahman, “PERBANDINGAN ALGORITMA NAIVE BAYES DAN KNN DALAM ANALISIS SENTIMEN ULASAN PENGGUNA APLIKASI CAPCUT,” vol. 12, 2024.
M. Saifurridho, M. Martanto, and U. Hayati, “Analisis Algoritma K-Nearest Neighbor terhadap Sentimen Pengguna Aplikasi Shopee,” Jurnal Informatika Terpadu, vol. 10, no. 1, pp. 21–26, 2024, doi: 10.54914/jit.v10i1.1054.
S. A. S. Mola, Iqbal Muhammad Iskandar, J. E. Pidu Dimu, and W. Y. Seran, “Analisis Sentimen Pembangunan Ibu Kota Negara Indonesia Menggunakan Metode Naïve Bayes, Dan K-Nearest Neighbor,” HOAQ (High Education of Organization Archive Quality) : Jurnal Teknologi Informasi, vol. 15, no. 2, pp. 151–157, 2024, doi: 10.52972/hoaq.vol15no2.p151-157.
D. Pratmanto, A. Widayanto, Y. Meisella Kristania, and R. Wijianto, “Analisis Perbandingan Algoritma Naive Bayes Dan KNN Untuk Analisis Sentimen Ulasan Pengguna Aplikasi Vidio Di Google Play Store,” CONTEN : Computer and Network Technology, vol. 4, no. 2, pp. 119–124, 2024, [Online]. Available: http://jurnal.bsi.ac.id/index.php/conten
M. Atalya Angelus Leza, N. Widya Utami, and P. Anugrah Cahya Dewi, “Prediksi Prestasi Siswa Smas Katolik Santo Yoseph Denpasar Berdasarkan Kedisiplinan Dan Tingkat Ekonomi Orang Tua Menggunakan Metode Knowledge Discovery in Database Dan Algoritma Regresi Linier Berganda,” JATI (Jurnal Mahasiswa Teknik Informatika), vol. 8, no. 1, pp. 373–379, 2024, doi: 10.36040/jati.v8i1.8754.
M. Yasir, Marissa Grace Haque, Robertus Suraji, and Istianingsih, “Analisis Sentimen Terhadap Kontroversi Fatwa MUI Nomor 83 Tahun 2023 Tentang Pemboikotan Produk yang Terafiliasi Israel,” Jurnal Ekonomi Manajemen Sistem Informasi, vol. 5, no. 4, pp. 409–422, 2024, doi: 10.31933/jemsi.v5i4.1845.
L. Hermawan and M. Bellaniar Ismiati, “Pembelajaran Text Preprocessing berbasis Simulator Untuk Mata Kuliah Information Retrieval,” Jurnal Transformatika, vol. 17, no. 2, p. 188, 2020, doi: 10.26623/transformatika.v17i2.1705.
D. Yulianto and A. Nugraheni, “DECODE : Jurnal Pendidikan Teknologi Informasi,” Jurnal Pendidikan Teknologi Informasi, vol. 1, no. 1, pp. 33–42, 2021.
W. Priatna, E. N. A’ini, J. Warta, Agus Hidayat, T. S. Lestari, and Rasim, “Sentiment Analysis of Bjorka Hacker Using the Naive Bayes and C.45 Algorithms,” Conference Series, vol. 4, no. 1, pp. 79–87, 2023, doi: 10.34306/conferenceseries.v4i1.614.
G. Urva, S.T.M.Kom et al., PENERAPAN DATA MINING DI BERBAGAI BIDANG (Konsep, Metode, dan Studi Kasus). PT. Sonpedia Publishing Indonesia, 2023.
R. T. Handayanto and H. Herlawati, Data Mining dan Machine Learning Menggunakan Matlab dan Python. Bandung: Informatika Bandung, 2020.
M. Taufik Sugandi, Martanto, and U. Hayati, “Analisis Sentimen Komentar Pengguna Youtube terhadap Kebijakan Baru Badan Penyelenggara Jaminan Kesehatan Sosial Menggunakan Naïve Bayes,” Jurnal Informatika dan Rekayasa Perangkat Lunak, vol. 6, no. 1, pp. 218–227, 2024.
R. T. S. A. Putri, D. E. Ratnawati, and D. W. Brata, “Perbandingan Naïve Bayes dan K-Nearest Neighbor untuk Analisis Sentimen Aplikasi Gapura UB Berdasarkan Ulasan Pengguna pada Playstore,” Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 7, no. 1, pp. 229–236, 2023, [Online]. Available: http://j-ptiik.ub.ac.id
M. Bedy Purnama, S.Si., Pengantar Machine Learning. Bandung: Informatika Bandung, 2019.
M. Yasir and R. Suraji, “Perbandingan Metode Klasifikasi Naive Bayes, Decision, Tree, Random Forest Terhadap Analisis Sentimen Kenaikan Biaya Haji 2023 pada Media Sosial Youtube,” Jurnal Cahaya Mandalika (JCM), vol. 3, no. 2, pp. 180–192, 2023.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Anisya Wulandari, Wowon Priatna, Muhammad Yasir

This work is licensed under a Creative Commons Attribution 4.0 International License.
Attribution 4.0 International
You are free to:
- Share — copy and redistribute the material in any medium or format for any purpose, even commercially.
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
- The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
- Attribution — You must give appropriate credit , provide a link to the license, and indicate if changes were made . You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation .
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.


