Comparison of Machine Learning Algorithms for Sentiment Analysis of Trans Jogja on Social Media

Putri Muryanti Setyowati, Yoga Pristyanto, Arif Nur Rohman

Abstract


The social media platform X has become an important channel for the public to express opinions and share experiences regarding public services, including Trans Jogja. User-generated content from this platform provides valuable insights into public perceptions of service quality. However, because these data consist of unstructured text, sentiment classification techniques based on machine learning are required to analyze them effectively. This study aims to compare the performance of several machine learning algorithms for sentiment classification, including Naïve Bayes, Support Vector Machine (SVM), Random Forest, Neural Network, Logistic Regression, and Decision Tree, in classifying user sentiment toward Trans Jogja on the X platform. Data were collected through a web crawling process using Tweet Harvest with keywords related to Trans Jogja, covering the period from January 1, 2025, to June 10, 2026, resulting in a dataset of 3,035 tweets. The preprocessing stage included data cleaning, case folding, tokenization, normalization, stopword removal, and stemming. Text representation was performed using the Term Frequency–Inverse Document Frequency (TF-IDF) method. The dataset was then divided into training and testing sets using five train–test split ratios: 90:10, 85:15, 80:20, 75:25, and 70:30. Model performance was evaluated using a confusion matrix and the corresponding accuracy, precision, recall, and F1-score metrics. The experimental results demonstrate that the Support Vector Machine (SVM) consistently outperformed the other algorithms across different data split ratios. At the 85:15 train–test split, the SVM achieved an accuracy of 91%, precision of 91%, recall of 91%, and an F1-score of 91%, indicating that it is the most effective algorithm for sentiment classification of Trans Jogja users on the X platform.

Keywords


machine learning; sentiment analysis; trans jogja; social media

Full Text:

PDF

References


A. W. Nurfadillah, Kiki Rasmala Sani, “Kebijakan Transportasi Publik dalam meningkatkan Pelayanan terhadap Masyarakat: Studi Kasus Penggunaan Transjogja,” Sawala : Jurnal Administrasi Negara, Vol. 11, No. 1, pp. 54–66, Jun. 2023, DOI: 10.30656/SAWALA.V11I1.5834.

K. F. Ramdhania, D. F. Hidayat, and R. Salkiawati, “Implementasi Metode Naïve Bayes dan Support Vector Machine (SVM) untuk menganalisis Sentimen Pengguna Twitter terhadap Transjakarta,” JMPM: Jurnal Matematika dan Pendidikan Matematika, Vol. 9, No. 1, pp. 1–14, Mar. 2024, DOI: 10.26594/JMPM.V9I1.4494.

F. S. Nufus and W. Gata, “Sentiment Analysis of Public Opinion on Transportation Services in Indonesia using Machine Learning,” Jurnal Techno Nusa Mandiri, Vol. 22, No. 2, pp. 143–150, Sep. 2025, DOI: 10.33480/TECHNO.V22I2.6577.

R. Fachreza and W. T. Handoko, “Analisis Sentimen Masyarakat terhadap Kinerja Trans Semarang menggunakan Metode Random Forest,” Progresif: Jurnal Ilmiah Komputer, Vol. 20, No. 2, pp. 724–734, Aug. 2024, DOI: 10.35889/PROGRESIF.V20I2.2093.

A. Purnamasari and A. Agoestanto, “Modeling of Naïve Bayes and Decision Tree Algorithms to Analyze Sentiment Related to Jaklingko Public Transportation on Social Media X (Twitter),” Vol. 5, No. 1, pp. 67–78, 2024, DOI: 10.30598/ppcst.2024.knmxxii.67-78.

A. Maulana, I. K. Afifah, A. Mubarrak, K. R. Fauzan, A. Dwintara, and B. P. Zen, “Comparison of Logistic Regression, Multinomialnb, SVM, and K-NN Methods on Sentiment Analysis of Gojek App Reviews on the Google Play Store,” Jurnal Teknik Informatika (Jutif), Vol. 4, No. 6, pp. 1487–1494, Dec. 2023, DOI: 10.52436/1.JUTIF.2023.4.6.863.

R. Ramadhani, “Analisis Sentimen Ulasan Platform Gojek menggunakan Artificial Neural Network (ANN),” Jun. 2025.

D. A. Ruriyanto, F. A. Raya, and R. Siswoyo, “Analisis Sentimen Ulasan Publik pada X menggunakan Naive Bayes untuk meningkatkan Kualitas Layanan Transjakarta,” Journal of Research and Publication Innovation, Vol. 4, No. 1, 2026, Accessed: May 16, 2026. [Online]. Available: http://jurnal.portalpublikasi.id/index.php/JORAPI/article/view/2039

R. N. Fitriyani, M. Jajuli, and Y. Umaidah, “Analisis Sentimen Pengguna KRL terhadap KAI Commuter Line melalui Sosial Media X dengan Algoritma Naive Bayes Classifier,” Jurnal Informatika dan Teknik Elektro Terapan, Vol. 13, No. 3S1, pp. 2830–7062, Oct. 2025, DOI: 10.23960/JITET.V13I3S1.7539.

S. Zaidan Ali Difyah, E. Arip Winanto, P. Alam Jusia, and F. Ilmu Komputer, “Analisis Sentimen terhadap Tagar Kabur Aja Dulu di Twitter menggunakan Metode Lexicon-based,” Jurnal PROCESSOR, Vol. 20, No. 2, Oct. 2025, DOI: 10.33998/PROCESSOR.2025.20.2.2542.

E. Febrianti, “Evaluasi Kepuasan Pengguna Transportasi Online di Indonesia melalui Analisis Sentimen Platform X dengan Pendekatan Lexicon-based,” urnal Sistem Informasi Komputer (SIKOM), Vol. 1, No. 2, 2024, Accessed: May 16, 2026. [Online]. Available: http://journal.beaninstitute.id/index.php/sikom/article/view/159

B. N. Azmi, A. Hermawan, and D. Avianto, “Analisis Pengaruh Komposisi Data Training dan Data Testing pada Penggunaan PCA dan Algoritma Decision Tree untuk Klasifikasi Penderita Penyakit Liver,” Jurnal Teknologi Informasi dan Multimedia, Vol. 4, No. 4, pp. 281–290, Feb. 2023, DOI: 10.35746/JTIM.V4I4.298.

A. Zein and D. Kusumaningsih, “Analisis Sentimen Review Pengguna Aplikasi BLU BCA pada Play Store menggunakan Algoritma Naïve Bayes,” senafti.budiluhur.ac.id, Vol. 4, No. 2, 2025, Accessed: May 16, 2026. [Online]. Available: https://senafti.budiluhur.ac.id/senafti/article/download/1703/895

M. Fadhilla, R. Wandri, A. Hanafiah, P. R. Setiawan, Y. Arta, and S. Daulay, “Analisis Performa Algoritma Machine Learning untuk Identifikasi Depresi pada Mahasiswa,” Journal of Informatics Management and Information Technology, Vol. 5, No. 1, pp. 40–47, Jan. 2025, DOI: 10.47065/JIMAT.V5I1.473.

P. K. Sari and R. R. Suryono, “Komparasi Algoritma Support Vector Machine dan Random Forest untuk Analisis Sentimen Metaverse,” Jurnal Mnemonic, Vol. 7, No. 1, pp. 31–39, Feb. 2024, DOI: 10.36040/MNEMONIC.V7I1.8977.

M. R. Adipratama and N. Safriadi, “Analisis Sentimen terhadap Rencana Penerapan E-Voting pada Pemilu di Indonesia,” JLK, Vol. 7, No. 1, 2024.

J. D. P. Beneng, “Analisis Sentimen Pengguna Twitter terhadap AI-Generated Art menggunakan Metode Naive Bayes dan Neural Network Classifier,” 2023. Accessed: May 16, 2026. [Online]. Available: https://eprints.unmer.ac.id/id/eprint/5452/

A. Sintawati, F. Amalya, A. Hidayat, and N. M. Supyan, “Evaluasi Kinerja SVM dan Logistic Regression pada Data Multiclass dalam Analisis Sentimen Film Dirty Vote dengan Metode Pelabelan Lexicon based,” RIGGS: Journal of Artificial Intelligence and Digital Business, Vol. 4, No. 2, pp. 821–832, May 2025, DOI: 10.31004/RIGGS.V4I2.576.

F. R. Valerian, M. Syarief, and D. A. Fatah, “Klasifikasi Tingkat Obesitas menggunakan Metode GBM dan Confusion Matrix,” JATI (Jurnal Mahasiswa Teknik Informatika), Vol. 9, No. 2, pp. 2242–2249, Mar. 2025, DOI: 10.36040/JATI.V9I2.13062.

O. Manullang, P. Cahyo, and N. H. Harani, “Analisis Sentimen untuk memprediksi Hasil Calon Pemilu Presiden menggunakan Lexicon based dan Random Forest,” Jurnal Ilmiah Informatika, Vol. 11, No. 02, pp. 159–169, Sep. 2023, DOI: 10.33884/JIF.V11I02.7987.




DOI: https://doi.org/10.32520/stmsi.v15i7.6494

Article Metrics

Abstract view : 4 times
PDF - 0 times

Refbacks

  • There are currently no refbacks.


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.