Perbandingan Random Forest dan SVM dalam Analisis Sentimen Opini Masyarakat Terhadap Kenaikan Harga Pertamax
Abstract
The increase in Pertamax prices triggered various responses from the public, many of which were expressed through social media X. Due to the large number of opinions that emerged, sentiment analysis proved to be an appropriate way to automatically recognize public opinion trends. This study was conducted with the aim of determining how effective the "Random Forest" and "Support Vector Machine" (SVM) algorithms are in the process of grouping public sentiment regarding the increase in Pertamax prices. The research data was obtained by collecting information from platform X using keywords that match the topic of Pertamax. After filtering and removing duplicates, 5,006 records were obtained which were used as the dataset in this study. The steps of this study include data pre-processing, sentiment classification process, feature extraction using the Term Frequency Inverse Document Frequency (TF-IDF) technique, Using the SMOTE method to balance the number of classes and divide the dataset into categories, then classifying with two algorithms, namely Random Forest and Support Vector Machine (SVM). Confusion matrix is used to assess model performance with various metrics such as accuracy, precision, recall, and F1 score. This study shows that the data is dominated by negative sentiment, amounting to 51.64%, then dominated by positive sentiment at 35.60%, and neutral sentiment reached 12.76%. Before using SMOTE, Random Forest had an accuracy of 73% while SVM reached 75%. After using SMOTE, the accuracy of the Random Forest model increased to 85% and the accuracy of the SVM increased to 89%. This research contributes to improving the quality of sentiment analysis and serves as a reference for future studies; furthermore, it provides stakeholders with an understanding of public opinion trends regarding the price hike of Pertamax, thereby assisting them in decision-making.
Downloads
References
W. M. S. N. Hutagalung, Tony, and N. J. Perdana, “Analisis Sentimen Pada Opini Kenaikan Harga Bahan Bakar Minyak Pada Media Sosial Twitter,” J. Sist. Inf. DAN Tek. Komput., vol. 8, no. 2, pp. 280–284, 2023.
T. Danirmala and Y. S. Nugroho, “Analisis Sentimen Terhadap Topik Kenaikan Harga Bahan Bakar Minyak (BBM) pada Media Sosial Twitter,” Indones. J. Comput. Sci., vol. 12, no. 3, pp. 1258–1268, 2023.
wilda Asmarini, “Sah! Pertamina Naikkan Sah! Pertamina Naikkan Harga BBM Pertamax Rabu 10 Juni 2026,” CNBC Indonesia. Accessed: Jun. 09, 2026. [Online]. Available: https://www.cnbcindonesia.com/news/20260609233802-4-741528/sah-pertamina-naikkan-harga-bbm-pertamax-rabu-10-juni-2026
I. Septiana and D. Alita, “Perbandingan Random Forest dan SVM dalam Analisis Sentimen Quick Count Pemilu 2024,” vol. 9, no. 3, pp. 224–233, 2024, doi: 10.30591/jpit.v9i3.6640.
S. Kemp, “Digital 2026: Indonesia,” Datareportal. Accessed: Nov. 05, 2025. [Online]. Available: https://datareportal.com/reports/digital-2026-indonesia
J. Stephanus, J. Tanujaya, and M. R. Pribadi, “Applied Information Technology and Computer Science Analisis Sentimen Masyarakat terhadap Kenaikan Harga BBM Non-Subsidi Akibat Penutupan Selat Hormuz Menggunakan IndoBERT,” vol. 5, no. 1, pp. 164–173, 2026.
H. Vazli and R. R. Suryono, “Komparasi model svm, naïve bayes, dan random forest dalam analisis sentimen terhadap percakapan publik tentang pertamina,” J. Ilm. Penelit. dan Pembelajaran Inform., vol. 11, no. 1, pp. 92–105, 2026.
R. Ramlan, N. Satyahadewi, and W. Andani, “Analisis Sentimen Pengguna Twitter Menggunakan Support Vector Machine Pada Kasus Kenaikan Harga BBM,” JAMBURA J. Math., vol. 5, no. 2, pp. 431–445, 2023.
S. Lina, M. Sitio, and R. Nadiyanti, “Analisis Sentimen Kenaikan Harga BBM Pertamax Pada Media Sosial Menggunakan Metode Naïve Bayes Classifier,” vol. 4, no. 3, pp. 1224–1231, 2022, doi: 10.47065/bits.v4i3.2331.
I. Amal and Jayanta, “Perbandingan Pelabelan Otomatis Dan Manual Untuk Analisis Sentimen Terhadap Kenaikan Harga BBM Pertamina Pada Twitter Menggunakan Algoritma Support Vector Machine,” Semin. Nas. Mhs. Ilmu Komput. dan Apl., pp. 473–487, 2023.
G. E. Yuliastuti, S. R. Wardhana, and A. Maulana, “Penerapan Insert-Lexicon untuk Analisis Sentimen Kenaikan Harga BBM pada Media Sosial Twitter,” J. Teknol. Inf. dan Komun., vol. 19, no. 2, pp. 93–100, 2024.
D. E. Saputra and A. R. Isnain, “Implementasi algoritma convolutional neural network untuk analisis sentimen bacapres 2024 pada kolom komentar youtube mata najwa,” J. Ilm. Penelit. dan Pembelajaran Inform., vol. 9, no. 3, pp. 1431–1441, 2024.
W. Romadhona and A. R. Isnain, “Analisis sentimen pengguna media sosial terhadap kebijakan kenaikan pajak hiburan menggunakan metode svm (support vector machine),” vol. 9, no. 4, pp. 2185–2195, 2024.
A. R. Isnain, N. S. Marga, and D. Alita, “Sentiment Analysis Of Government Policy On Corona Case Using Naive Bayes Algorithm,” vol. 15, no. 1, pp. 55–64, 2021.
A. F. Wibowo and A. Susanto, “Analisis Sentimen Twitter Terhadap Isu Royalti Lagu di Industri Musik Indonesia Menggunakan Naive Bayes dan Support Vector Machine Berbasis TF-IDF,” vol. 8, no. 1, pp. 330–341, 2026, doi: 10.47065/bits.v8i1.9842.
A. Farhan, I. Ridat, and A. R. Isnain, “Pemodelan topik dengan lda untuk memahami persepsi publik terhadap apple vision pro melalui analisis berita twitter,” vol. 10, no. 4, pp. 3233–3246, 2025.
N. Wayan, A. Sekar, and A. R. Isnain, “Analisis Sentimen Terhadap Media Sosial Twitter dengan Kasus Kampanye Anti-Korupsi di Indonesia Menggunakan Naive Bayes,” vol. 8, no. April, pp. 695–703, 2024, doi: 10.30865/mib.v8i2.7582.
D. F. Sebastian, H. Sulistiani, and A. R. Isnain, “Sentiment Analysis Of Public Opinion On The Right Of Inquiry In Indonesia In 2024 Using The Support Vector Machine ( Svm ) Method,” vol. 5, no. 4, pp. 1025–1034, 2024.
P. Elisa and A. Rahman Isnain, “Comparison Of Random Forest, Support Vector Machine And Naive Bayes Algorithms To Analyze Sentiment Towards Mental Health Stigma,” J. Tek. Inform., vol. 5, no. 1, pp. 321–329, 2024, doi: 10.52436/1.jutif.2024.5.1.1817.
L. Najib, A. A. Mahfudh, and S. Bakhri, “Analisis Sentimen Persepsi Publik Terhadap Program MBG Pada Komentar YouTube Menggunakan Naïve Bayes dan Resampling,” vol. 7, no. 4, pp. 2467–2478, 2026, doi: 10.47065/bits.v7i4.9400.
M. Samantri and Afiyati, “Perbandingan Algoritma Support Vector Machine dan Random Forest untuk Analisis Sentimen Terhadap Kebijakan Pemerintah Indonesia Terkait Kenaikan Harga BBM Tahun 2022,” J. Teknol. Inf. dan Komun., vol. 8, no. 1, pp. 1–9, 2024.
A. R. Isnain, J. Supriyanto, and M. P. Kharisma, “Implementation of K-Nearest Neighbor ( K-NN ) Algorithm For Public Sentiment Analysis of Online Learning,” Indones. J. Comput. Cybern. Syst., vol. 15, no. 2, pp. 121–130, 2021, doi: 10.22146/ijccs.65176.
N. Hendrastuty, A. Rahman Isnain, and A. Yanti Rahmadhani, “Analisis Sentimen Masyarakat Terhadap Program Kartu Prakerja Pada Twitter Dengan Metode Support Vector Machine,” J. Inform. J. Pengemb. IT, vol. 6, no. 3, pp. 150–155, 2021, [Online]. Available: http://situs.com
S. B. Setiawan and A. R. Isnain, “Sentimen Analisis Masyarakat Terhadap Pembangunan IKN Menggunakan Algoritma Lexicon Based Approach dan Naïve Bayes,” vol. 8, no. April 2019, pp. 1019–1030, 2024, doi: 10.30865/mib.v8i2.7605.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Perbandingan Random Forest dan SVM dalam Analisis Sentimen Opini Masyarakat Terhadap Kenaikan Harga Pertamax
Pages: 846-858
Copyright (c) 2026 Fahmy Wira Oktavier, Auliya Rahman Isnain

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).





















