Comparison of The Accuracy of K-Nearest Neighbor and Roberta Algorithm in Analysis of Sentiment on Miawaug Youtube Channel Comments
DOI:
https://doi.org/10.34148/teknika.v14i1.1117Keywords:
Sentiment Analysis, K-Nearest Neighbor (KNN), RoBERTa, YouTube CommentsAbstract
This study aims to evaluate the accuracy of two algorithms, K-Nearest Neighbor (KNN) and Robustly Optimized BERT Approach (RoBERTa), in analyzing sentiment within comments on MiawAug’s YouTube channel. Sentiment analysis was conducted on two sentiment categories: binary classification (positive and negative) and multi-class classification (positive, neutral, and negative). Using KNN, the binary classification yielded an accuracy of 86.12%, F1-score of 87.44%, recall of 96.64%, and precision of 79.89%. In contrast, the multi-class classification achieved 98.21% accuracy, F1-score, and recall with a precision of 98.23%. However, the RoBERTa model outperformed KNN, achieving 93.89% accuracy, 93.88% F1-score, 94.59% recall, and 93.22% precision in binary classification. For multi-class classification, RoBERTa further excelled, attaining 99.21% across accuracy, F1-score, recall, and precision. These findings demonstrate that RoBERTa surpasses KNN in sentiment analysis, especially in multi-class contexts, indicating its greater robustness for this application.
Downloads
References
[1] S. Khairunnisa, A. Adiwijaya, and S. Al Faraby, “Pengaruh Text Preprocessing terhadap Analisis Sentimen Komentar Masyarakat pada Media Sosial Twitter (Studi Kasus Pandemi COVID-19),” J. Media Inform. Budidarma, vol. 5, no. 2, p. 406, 2021, doi: 10.30865/mib.v5i2.2835.
[2] N. Putu et al., “Analisa Penerapan Tax Treaty Indonesia Dengan Amerika Dalam Pajak Adsense Youtube Partner Program Di Indonesia,” J. Kertha Desa, vol. 11, no. 6, pp. 2704–2714, 2023, [Online]. Available: https://voi.id/teknologi/39265/youtuber-kena-pajak-pemerintah-as-begini-hitung-
[3] M. Takhim, A. I. Fadila, and M. Maskudi, “Monetasi Youtube Perspektif Fikih Muamalah,” J. Multidisiplin Madani, vol. 2, no. 2, pp. 1019–1034, 2022, doi: 10.54259/mudima.v2i2.484.
[4] A. S. Lubis, “Effect of Adsense on Deddy Corbuzier ’ s YouTube on the Viewing Interests and Viewing Actions of Universitas Sumatera Utara Students,” no. July 2006, pp. 666–671, 2023.
[5] S. Informasi, F. Teknik, and U. Bakrie, “Perbandingan Performa Algoritma VADER dan RoBERTa pada Twitter Comparison of VADER and RoBERTa Algorithm Performance on,” vol. 13, pp. 1547–1557, 2024.
[6] J. W. Iskandar and Y. Nataliani, “Perbandingan Naïve Bayes, SVM, dan k-NN untuk Analisis Sentimen Gadget Berbasis Aspek,” J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 5, no. 6, pp. 1120–1126, 2021, doi: 10.29207/resti.v5i6.3588.
[7] Y. Liu et al., “RoBERTa: A Robustly Optimized BERT Pretraining Approach,” no. 1, 2019, [Online]. Available: http://arxiv.org/abs/1907.11692
[8] K. L. Tan, C. P. Lee, K. M. Lim, and K. S. M. Anbananthen, “Sentiment Analysis With Ensemble Hybrid Deep Learning Model,” IEEE Access, vol. 10, no. September, pp. 103694–103704, 2022, doi: 10.1109/ACCESS.2022.3210182.
[9] A. A. Azhari, Y. Sibaroni, and S. S. Prasetiyowati, “Detection of Indonesian Hate Speech in the Comments Column of Indone-sian Artists’ Instagram Using the RoBERTa Method,” JIPI (Jurnal Ilm. Penelit. dan Pembelajaran Inform., vol. 8, no. 3, pp. 764–773, 2023, doi: 10.29100/jipi.v8i3.3898.
[10] M. J. Palepa, N. Pratiwi, and R. Q. Rohmansa, “Analisis Sentimen Masyarakat Tentang Pengaruh Politik Identitas Pada Pemilu 2024 Terhadap Toleransi Beragama Menggunakan Metode K - Nearest Neighbor,” JIPI (Jurnal Ilm. Penelit. dan Pembelajaran Inform., vol. 9, no. 1, pp. 389–401, 2024, doi: 10.29100/jipi.v9i1.4957.
[11] G. R. Putri, M. A. Maulana, and S. Bahri, “Perbandingan Algoritma Naïve Bayes dan TextBlob Untuk Mendapatkan Analisis Sentimen Masyarakat Pada Sosial Media,” Teknika, vol. 13, no. 2, pp. 213–218, 2024, doi: 10.34148/teknika.v13i2.815.
[12] M. A. A. Yani and W. Maharani, “Analyzing Cyberbullying Negative Content on Twitter Social Media with the RoBERTa Method,” JINAV J. Inf. Vis., vol. 4, no. 1, pp. 61–69, 2023, doi: 10.35877/454ri.jinav1543.
[13] Athirah Rifdha Aryani and Erwin Budi Setiawan, “Big Five Personality Assessment Using KNN method with RoBERTA,” J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 6, no. 5, pp. 818–823, 2022, doi: 10.29207/resti.v6i5.4394.
[14] R. A. Putra, R. Novita, T. K. Ahsyar, and Zarnelly, “Implementation of Classification Algorithm for Sentiment Analysis: Measuring App User Satisfaction,” Teknika, vol. 13, no. 2, pp. 204–212, 2024, doi: 10.34148/teknika.v13i2.827.

Downloads
Published
Issue
Section
License
Copyright (c) 2025 Teknika

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