Energy: Jurnal Ilmiah Ilmu-ilmu Teknik
ENERGY: JURNAL ILMIAH ILMU-ILMU TEKNIK (Special Issue on Engineering Paradigm 2025 Edition)

Sentiment Analysis of YouTube Comments Using the K-Nearest Neighbors (KNN) Method from an Axiological Perspective

Merinda Lestandy (Department of Electrical Engineering, Universitas Muhammadiyah Malang, 65144, Indonesia)
Syaad Patmanthara (Department of Electrical Engineering and Informatics, Universitas Negeri Malang, 65145, Indonesia)



Article Info

Publish Date
30 Dec 2025

Abstract

The rapid development of social media as a space for digital interaction has increased the need for sentiment analysis to understand public opinion in a systematic and measurable way. This study analyzes YouTube comment sentiment using the K-Nearest Neighbor (K-NN) method while also examining the axiological value of applying this technology in support of a more ethical digital ecosystem. The dataset consists of 8,200 YouTube comments obtained from Kaggle without predefined sentiment labels. The data were preprocessed through case folding, tokenization, stopword removal, stemming, and normalization. Initial sentiment labels were generated automatically using K-Means clustering to form two classes—positive and negative—and were partially verified manually. The labeled data were split into training and testing sets with ratios of 50:50, 60:40, 70:30, and 80:20, and evaluated using K-NN with k values of 3, 5, 7, and 9. Model performance was assessed using a confusion matrix with accuracy, precision, recall, and F1-score metrics. The results show that accuracy ranges from 0.95 to 0.96, with the best performance achieved at a 70:30 split and an optimal k value yielding 0.96 accuracy. Beyond technical contributions, this study highlights the ethical and practical value of sentiment analysis for interpreting public opinion, supporting fairer content moderation, and improving communication quality in social media environments.

Copyrights © 2025






Journal Info

Abbrev

energy

Publisher

Subject

Automotive Engineering Chemical Engineering, Chemistry & Bioengineering Civil Engineering, Building, Construction & Architecture Computer Science & IT Control & Systems Engineering Earth & Planetary Sciences Electrical & Electronics Engineering Energy Engineering Industrial & Manufacturing Engineering Materials Science & Nanotechnology Mechanical Engineering

Description

Energy Journal serves as a platform for information and communication of various research findings and scientific writings in the field of engineering, contributed by practitioners, researchers, and academics who are involved in and have a keen interest in the development of science and technology. ...