Khazanah Informatika : Jurnal Ilmu Komputer dan Informatika
Vol. 11 No. 1 (2025): April 2025

Optimization of Sentiment Analysis of Government Regulation in Lieu of Law on Job Creation Using KNN, Random Forest, and PSO

Lestari, Sri (Unknown)
Tupari (Unknown)
Yan Aditiya Pratama (Unknown)
Suhendro (Unknown)



Article Info

Publish Date
29 Jul 2025

Abstract

Twitter is one of the social media used by the public to convey their views regarding the government's policy of issuing a Government Regulations in Lieu of Laws (Bahasa: Peraturan Pemerintah Pengganti Undang-undang (Perpu)). The public's pros and cons of this policy are material for sentiment analysis. The purpose of this study was to analyze Twitter users' opinions regarding the Job Creation Perpu using the K-Nearest Neighbors (KNN), Random Forest (RF), and Particle Swarm Optimization (PSO) methods. The data was 3.128 tweets from Twitter social media users regarding the Government Regulation in Lieu of Law on Job Creation. Based on 3.128 data, 1.599 sentiments were positive, 1.473 sentiments were negative and 53 sentiments were neutral. The results showed that PSO feature optimized Twitter social media sentiment analysis against this regulation. KNN and RF algorithms for sentiment analysis was carried out before and after optimization with PSO. Experimental results using RapidMiner 9.10 showed that PSO feature succeeded in increasing classification accuracy in both algorithms. Before optimization, the KNN accuracy value reached 80.40%, then increased significantly to 85.23% after optimization with PSO was applied. Meanwhile, Random Forest accuracy value before optimization was 77.21% and increased to 80.53% after PSO was applied. This result indicated that the PSO-based KNN algorithm had better performance in conducting sentiment analysis of the Government Regulation in Lieu of Law on Job Creation on Twitter compared to the Random Forest algorithm in the context of this study. It concluded that Random Forest algorithm based on PSO is the best classifier for sentiment analysis and a potential and effective algorithm for classifying and analyzing sentiment on the same topic.

Copyrights © 2025






Journal Info

Abbrev

khif

Publisher

Subject

Computer Science & IT Control & Systems Engineering

Description

Khazanah Informatika : Jurnal Ilmu Komputer dan Informatika, an Indonesian national journal, publishes high-quality research papers in the broad field of Informatics and Computer Science, which encompasses software engineering, information system development, computer systems, computer network, ...