Analisis Sentimen Masyarakat Terhadap Pembatasan BBM Pertalite Menggunakan Random Forest dan K-Nearest Neighbor
DOI:
https://doi.org/10.47065/bulletincsr.v5i4.547Keywords:
Confusion Matrix; Crawling; K-Nearest Neighbor; Preprocessing; Random ForestAbstract
This study aims to analyze public opinion regarding the policy of limiting the use of Pertalite fuel by examining user comments on the Instagram platform. To classify these opinions, classification approaches using K-Nearest Neighbor (KNN) and Random Forest algorithms were employed. Comments were categorized into three sentiment expressions: positive, negative, and neutral. The research stages included data collection (crawling), text cleaning and normalization, sentiment labeling, weighting using the TF-IDF technique, model development, and performance evaluation. A total of 2,081 comments were used, with 1,000 comments labeled by language experts as training data, and the remaining used for testing. Model evaluation was conducted using two data splitting ratios, 80:20 and 70:30, to assess classification stability and accuracy. The results indicate that the Random Forest algorithm consistently outperforms KNN, achieving the highest accuracy of 73% under the 80:20 scenario. The classification distribution suggests a dominance of negative sentiment in public opinion toward the policy. These findings reflect public dissatisfaction and serve as critical input for the government in reviewing the subsidized fuel distribution policy. This research also highlights the potential of social media as an alternative data source for real-time public perception analysis.
Downloads
References
E. Setiawati and A. L. Suryanli, “DAMPAK EKONOMIS DAN PSIKOLOGIS KENAIKAN HARGA BBM,” j. ekon. manaj. akunt. perbank. syariah, vol. 12, no. 1, pp. 298–316, Mar. 2023, [Online]. Available: https://journal.uwgm.ac.id/ekonomika/article/view/1949
A. Shinta and K. Y. S. Putri, “Efektivitas Media Sosial Instagram Terhadap Personal Branding Bintang Emon Pada Pengguna Instagram,” Communicology: Jurnal Ilmu Komunikasi, vol. 9, no. 1, pp. 98–122, 2021, doi: 10.21009/COMMUNICOLOGY.021.08.
F. A. Indriyani, A. Fauzi, and S. Faisal, “Analisis sentimen aplikasi tiktok menggunakan algoritma naïve bayes dan support vector machine,” TEKNOSAINS: Jurnal Sains, Teknologi dan Informatika, vol. 10, no. 2, pp. 176–184, 2023, doi: https://doi.org/10.57152/malcom.v4i3.1482.
M. Samantri, “Perbandingan Algoritma Support Vector Machine dan Random Forest untuk Analisis Sentimen Terhadap Kebijakan Pemerintah Indonesia Terkait Kenaikan Harga BBM Tahun 2022,” Jurnal JTIK (Jurnal Teknologi Informasi dan Komunikasi), vol. 8, no. 1, pp. 1–9, 2024, doi: https://doi.org/10.35870/jtik.v8i1.1202.
G. F. I. M. D. A. Chrisley Heltroyce, “Analisis Sentimen Terhadap Kenaikan Harga Bahan Bakar Minyak Menggunakan Algoritma K-Nearest Neighbor,” Jurnal Kesehatan, Sains, dan Teknologi (JAKASAKTI), vol. 3, no. 1, pp. 227–232, Apr. 2024, doi: https://doi.org/10.36002/js.v3i1.
N. Alvionika, S. Faisal, R. Rahmat, and A. F. N. Masruriyah, “Analisis Sentimen Pada Komentar Instagram Provider By. U Menggunakan Metode K-Nearest Neighbors (KNN),” Jurnal Algoritma, vol. 21, no. 2, pp. 50–63, 2024, doi: https://doi.org/10.33364/algoritma/v.21-2.1672.
S. Rahayu, Y. Mz, J. E. Bororing, and R. Hadiyat, “Implementasi Metode K-Nearest Neighbor (K-NN) untuk Analisis Sentimen Kepuasan Pengguna Aplikasi Teknologi Finansial FLIP,” Edumatic J. Pendidik. Inform, vol. 6, no. 1, pp. 98–106, 2022, doi: 10.29408/edumatic.v6i1.5433.
A. Amelia, L. N. Hayati, and H. Darwis, “Analisis Sentimen Masyarakat Terhadap Sistem Pembayaran Mypertamina dengan Metode Random Forest, SVM, dan Naïve Bayes,” LINIER: Literatur Informatika dan Komputer, vol. 1, no. 1, pp. 28–44, 2024, doi: https://doi.org/10.33096/linier.v1i1.2269.
F. A. Larasati, D. E. Ratnawati, and B. T. Hanggara, “Analisis Sentimen Ulasan Aplikasi Dana dengan Metode Random Forest,” Jurnal Pengembangan Teknologi Informasi Dan Ilmu Komputer, vol. 6, no. 9, pp. 4305–4313, 2022, [Online]. Available: https://j-ptiik.ub.ac.id/index.php/j-ptiik/article/view/11562
H. Taufiqqurrahman, F. T. Anggraeny, and M. M. Al Haromainy, “Perbandingan Algoritma Naïve Bayes Dan K-Nearest Neighbor Pada Analisis Sentimen Ulasan Aplikasi Mypertamina,” JATI (Jurnal Mahasiswa Teknik Informatika), vol. 7, no. 6, pp. 3934–3939, 2023, doi: https://doi.org/10.36040/jati.v7i6.7801.
D. A. Agustina, S. Subanti, and E. Zukhronah, “Implementasi Text Mining Pada Analisis Sentimen Pengguna Twitter Terhadap Marketplace di Indonesia Menggunakan Algoritma Support Vector Machine,” Indonesian Journal of Applied Statistics, vol. 3, no. 2, pp. 109–122, 2021, doi: 10.26418/jp.v8i3.56478.
T. F. Basar, D. E. Ratnawati, and I. Arwani, “Analisis Sentimen Pengguna Twitter terhadap Pembayaran Cashless menggunakan Shopeepay dengan Algoritma Random Forest,” Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 6, no. 3, pp. 1426–1433, 2022, [Online]. Available: https://j-ptiik.ub.ac.id/index.php/j-ptiik/article/view/10830
S. , & W. S. Yahya, “Analisis Sentimen Analisis Sentimen Publik Terhadap Pariwisata Aceh di Media Sosial X Menggunakan Algoritma Naive Bayes Classifier.,” Bulletin of Information Technology (BIT, vol. 5, no. 4, pp. 269–278, 2024, doi: https://doi.org/10.47065/bit.v5i4.1700.
N. A. R. Putri, “Analisis Jaringan pada Media Sosial X dengan# Boikot Menggunakan Social Network Analysis,” Analisis Jaringan pada Media Sosial X dengan# Boikot Menggunakan Social Network Analysis, vol. 2, no. 1, pp. 11–5, 2024, [Online]. Available: https://ojisnu.isnuponorogo.org/index.php/ijitech/article/view/79
M. Afdal and L. R. Elita, “Penerapan Text Mining Pada Aplikasi Tokopedia Menggunakan Algoritma K-Nearest Neighbor,” Jurnal Ilmiah Rekayasa dan Manajemen Sistem Informasi, vol. 8, no. 1, pp. 78–87, Feb. 2022, [Online]. Available: https://scispace.com/pdf/penerapan-text-mining-pada-aplikasi-tokopedia-menggunakan-2hggn3of.pdf
Y. Khoiruddin, A. Fauzi, and A. M. Siregar, “Analisis Sentimen Gojek Indonesia Pada Twitter Menggunakan Algoritme Naïve Bayes Dan Support Vector Machine,” Progresif: Jurnal Ilmiah Komputer, vol. 19, no. 1, pp. 391–400, 2023, doi: 10.35889/progresif.v19i1.1173.
Yeni Kustiyahningsih, Ikromul Islam, Bain Khusnul Khotimah, and Jaka Purnama, “Sentiment Analysis for Indonesian Salt Policy uses Naïve Bayes and Information Gain Methods,” Technium: Romanian Journal of Applied Sciences and Technology, vol. 17, no. 1, pp. 440–445, Nov. 2023, doi: 10.47577/technium.v17i.10121.
J. A. Septian, T. M. Fachrudin, and A. Nugroho, “Analisis Sentimen Pengguna Twitter Terhadap Polemik Persepakbolaan Indonesia Menggunakan Pembobotan TF-IDF dan K-Nearest Neighbor,” INSYST: Journal of Intelligent System and Computation, vol. 1, no. 1, pp. 43–49, 2019, doi: https://doi.org/10.52985/insyst.v1i1.36.
Yerik Afrianto Singgalen, “Analisis Sentimen Wisatawan terhadap Taman Nasional Bunaken dan Top 10 Hotel Rekomendasi Tripadvisor Menggunakan Algoritma SVM dan DT berbasis CRISP-DM,” Journal of Computer System and Informatics (JoSYC), vol. 4, no. 2, pp. 367–379, Feb. 2023, doi: https://doi.org/10.47065/josyc.v4i2.3092.
R. Rahmadini, E. E. LorencisLubis, A. Priansyah, R. W. N. Yolanda, and T. Meutia, “Penerapan Data Mining Untuk Memprediksi Harga Bahan Pangan Di Indonesia Menggunakan Algoritma K-Nearest Neighbor,” Jurnal Mahasiswa Akuntansi Samudra, vol. 4, no. 4, pp. 223–235, 2023, doi: https://doi.org/10.33059/jmas.v4i4.7074.
D. E. R. B. R. Cahyo Gusti Indrayanto, “Analisis Sentimen Data Ulasan Pengguna Aplikasi MyPertamina di Indonesia pada Google Play Store menggunakan Metode Random Forest,” Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 7, no. 3, pp. 1131–1139, Mar. 2023, [Online]. Available: https://j-ptiik.ub.ac.id/index.php/j-ptiik/article/view/12390
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Analisis Sentimen Masyarakat Terhadap Pembatasan BBM Pertalite Menggunakan Random Forest dan K-Nearest Neighbor
ARTICLE HISTORY
How to Cite
Issue
Section
Copyright (c) 2025 Farhan Muhammad Fadillah, Yana Cahyana, Rahmat, Ahmad Fauzi

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).