Jurnal Media Computer Science
Vol 5 No 2 (2026): April

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

Nurpadhilah, Naurah Atikah (Unknown)
Saputera, Surya Ade (Unknown)



Article Info

Publish Date
30 Apr 2026

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.

Copyrights © 2026






Journal Info

Abbrev

jmcs

Publisher

Subject

Computer Science & IT

Description

Jurnal Media Computer Science merupakan jurnal nasional yang diterbitkan oleh Universitas Dehasen Bengkulu sejak tahun 2022. Jurnal Media Computer Science memuat artikel hasil-hasil penelitian di bidang Komputer, Sistem Informasi dan Teknologi. Jurnal Media Computer Science berkomitmen untuk menjadi ...