Inspiration: Jurnal Teknologi Informasi dan Komunikasi
Vol. 15 No. 2 (2025): Inspiration: Jurnal Teknologi Informasi dan Komunikasi

Implementation of Random Forest for Sentiment Analysis of YouTube Comments Related To The TNI Law Revision

virna, virna afrilianty (Unknown)
Nur Insani, Chairi (Unknown)
Arifin, Nurhikma (Unknown)
Furqan Rasyid, Muhammad (Unknown)



Article Info

Publish Date
29 Dec 2025

Abstract

Social media platforms such as YouTube have become important spaces for the public to express opinions on various policy issues, including the Draft Bill on the Indonesian National Armed Forces (RUU TNI). However, research on sentiment analysis of YouTube comments remains limited, particularly in the application of multi-class classification using the Random Forest algorithm. This study aims to implement Random Forest for classifying sentiments in YouTube comments related to the RUU TNI into three categories: positive, negative, and neutral. The dataset consists of 7118 comments, divided into 5694 training data and 1423 testing data. Sentiment labeling was conducted using a lexicon-based approach, while text representation was carried out using TF-IDF. To address data imbalance, class weighting was applied, and model parameter optimization was performed using the GridSearchCV technique. The optimal parameter combination obtained was n_estimators=300, max_depth=None, max_features='log2', and min_samples_split=20. The evaluation results show that the model with class weighting achieved an accuracy of 80.27%, while the model without weighting achieved 79.42%. These findings indicate that applying class weighting and parameter optimization effectively improves sentiment classification performance of public opinions on the RUU TNI policy on YouTube.

Copyrights © 2025






Journal Info

Abbrev

inspiration

Publisher

Subject

Computer Science & IT

Description

Inspiration: Jurnal Teknologi Informasi dan Komunikasi is a scientific journal that publishes research results in the field of Information and Communication Technology (ICT). The ICT research area that is the focus of this journal can be seen on the Focus and Scope page. Journals are published twice ...