Sentiment Analysis and Characteristics of Youtube User Opinions Toward Samsung and Iphone Brands Using TF-IDF With Naive Bayes and KNN Comparison and Mcnemar Test

  • Naurah Atikah Nurpadhilah Universitas Muhammadiyah Bengkulu
  • Surya Ade Saputera Universitas Muhammadiyah Bengkulu
Keywords: IPhone, K-Nearest Neighbor, Naive Bayes, Samsung, Sentiment Analysis, TF-IDF, YouTube

Abstract

The development of social media, particularly YouTube, has generated a large amount of public opinion data that can be utilized to understand user perceptions of products. Samsung and iPhone are two smartphone brands with intense market competition and are frequently discussed in YouTube comment sections. This study aims to compare the performance of the Naive Bayes and K-Nearest Neighbor (KNN) algorithms in sentiment analysis of YouTube comments related to these two brands. The research data were collected through a YouTube comment scraping process using the youtube-comment-downloader library. The research stages included data collection, text pre-processing consisting of case folding, punctuation removal, number removal, stopword removal, and stemming using the Sastrawi library. Furthermore, the text data were transformed into numerical representations using the Term Frequency-Inverse Document Frequency (TF-IDF) method. The classification process was carried out using the Naive Bayes and KNN algorithms and evaluated using accuracy, classification reports, confusion matrices, and the McNemar test to determine the significance of performance differences between the models. In addition, this study also analyzed word distribution based on sentiment and brand using WordCloud visualization. The results indicate that both algorithms are capable of classifying comment sentiments effectively and provide insights into user opinion characteristics toward Samsung and iPhone based on YouTube comments.

Downloads

Download data is not yet available.
Published
2026-04-30
How to Cite
Nurpadhilah, N., & Saputera, S. (2026). Sentiment Analysis and Characteristics of Youtube User Opinions Toward Samsung and Iphone Brands Using TF-IDF With Naive Bayes and KNN Comparison and Mcnemar Test. Jurnal Media Computer Science, 5(2), 987-998. https://doi.org/10.37676/jmcs.v5i2.11311
Section
Articles