Comparative Analysis of Machine Learning Algorithms for Indonesian Twitter Sentiment Classification on the Jakarta–Bandung High-Speed Rail Project

Authors

  • Muhammad Noerhadi Universitas Informatika dan Bisnis Indonesia image/svg+xml Author
    • Budiman Universitas Informatika dan Bisnis Indonesia image/svg+xml Author
      • Sardjono Universitas Informatika dan Bisnis Indonesia image/svg+xml Author

        DOI:

        https://doi.org/10.65780/bima.v1i1.3

        Keywords:

        sentiment analysis, social media, machine learning, Indonesian language, Support Vector Machine

        Abstract

        The rapid growth of social media in Indonesia has opened up new opportunities to gauge public opinion on major national initiatives. One of the most controversial projects is the Jakarta–Bandung High-Speed Railway (KCJB), which has sparked mixed responses due to its financial, environmental, and socio-political implications. To meet the need for systematic analysis, this study applies sentiment analysis to Indonesian Twitter data to evaluate public perspectives on the KCJB project. This research uses a step-by-step methodology, including data collection via the Twitter API, text preprocessing, manual tagging into positive and negative sentiments, and feature extraction using the Term Frequency–Inverse Document Frequency (TF-IDF) method. Four machine learning algorithms—Naïve Bayes, Support Vector Machine (SVM), K-Nearest Neighbors (K-NN), and Random Forest—were trained and verified on stratified data splits, with performance evaluated using accuracy, precision, recall, F1-score, and Area Under the Curve (AUC). The results show that SVM consistently outperforms other models, achieving up to 73% accuracy with balanced precision and recall, as well as the highest AUC value. These findings confirm the robustness of SVM in handling high-dimensional Indonesian text. In addition to its academic contribution to sentiment analysis in languages with limited resources, this research offers practical implications by providing data-driven insights for policymakers and businesses for real-time monitoring, strategic communication, and informed decision-making.

        Downloads

        Download data is not yet available.

        References

        [1] S. Ezung and K. O. Koza, ‘The Influence of Social Media on Public Discourse: Examining How Social Media Shape Popular Opinion’, Dec. 2024, doi: 10.5281/ZENODO.14252454.

        [2] H. U. Khan, S. Nasir, K. Nasim, D. Shabbir, and A. Mahmood, ‘Twitter trends: A ranking algorithm analysis on real time data’, Expert Systems with Applications, vol. 164, p. 113990, Feb. 2021, doi: 10.1016/j.eswa.2020.113990.

        [3] Y. Özkent, ‘Social media usage to share information in communication journals: An analysis of social media activity and article citations’, PLOS ONE, vol. 17, no. 2, p. e0263725, Feb. 2022, doi: 10.1371/journal.pone.0263725.

        [4] K. Khoirunurrofik, C. Endrina Dewi, and A. Marwah Zulkarnain, ‘Exploring the public sentiment of local community on major infrastructure development: Evidence from media news and Twitter data’, Journal of Human Behavior in the Social Environment, vol. 34, no. 3, pp. 423–443, Apr. 2024, doi: 10.1080/10911359.2023.2249962.

        [5] J. Widodo and K. Kusnan, ‘Mapping and Analyzing E-Government Sentiments in Local Governments in Indonesia’, Society, vol. 11, no. 2, pp. 434–457, Dec. 2023, doi: 10.33019/society.v11i2.558.

        [6] T. Wijaya, ‘"Risk is not Measured, but Contested and Compromised”: A Case Study of Jakarta–Bandung High-Speed Railway’, Journal of Contemporary Asia, vol. 55, no. 3, pp. 405–429, May 2025, doi: 10.1080/00472336.2024.2378856.

        [7] A. Ullah, S. N. Khan, and N. M. Nawi, ‘Review on sentiment analysis for text classification techniques from 2010 to 2021’, Multimed Tools Appl, vol. 82, no. 6, pp. 8137–8193, Mar. 2023, doi: 10.1007/s11042-022-14112-3.

        [8] B. Budiman, Z. S. Anggraeni, C. Habibi, and N. Alamsyah, ‘Analisis Sentimen Publik pada Media Sosial Twitter Terhadap Tiket.com Menggunakan Algoritma Klasifikasi’, Jurnal Informatika, vol. 11, no. 1, Art. no. 1, Apr. 2024, doi: 10.31294/inf.v11i1.17988.

        [9] D. P. Sari, Budiman, and N. Alamsyah, ‘Analisis Perbandingan Sentimen Pengguna Twitter Terhadap Layanan Salah Satu Provider Internet Di Indonesia Menggunakan Metode Klasifikasi’, TEMATIK, vol. 10, no. 2, Art. no. 2, Dec. 2023, doi: 10.38204/tematik.v10i2.1578.

        [10] N. Alamsyah, T. P. Yoga, Budiman, I. Akbar, A. Hendra, and A. J. Prima, ‘A Bidirectional GRU Approach with Hyperparameter Optimization for Sentiment Classification in Game Reviews : Pendekatan GRU Dua Arah dengan Optimasi Hiperparameter untuk Klasifikasi Sentimen dalam Ulasan Game’, NUANSA INFORMATIKA, vol. 19, no. 2, pp. 88–95, Jul. 2025, doi: 10.25134/ilkom.v19i2.399.

        [11] N. Alamsyah, G. B. Wibisono, T. P. Yoga, Budiman, and A. Hendra, ‘Emoji-Based Sentiment Classification Using Ensemble Learning with Cross-Validation: A Lightweight Approach for Social Media Analysis: Klasifikasi Sentimen Berbasis Emoji Menggunakan Ensemble Learning dengan Validasi Silang: Pendekatan Ringan untuk Analisis Media Sosial’, NUANSA INFORMATIKA, vol. 19, no. 2, pp. 81–87, Jul. 2025, doi: 10.25134/ilkom.v19i2.396.

        [12] K. H. Oo, ‘Comparing Accuracy Between SVM, Random Forest, K-NN Text Classifier Algorithms for Detecting Syntactic Ambiguity in Software Requirements’, in International Conference on Information Systems and Intelligent Applications, M. Al-Emran, M. A. Al-Sharafi, and K. Shaalan, Eds., Cham: Springer International Publishing, 2023, pp. 43–58. doi: 10.1007/978-3-031-16865-9_4.

        [13] R. Obiedat et al., ‘Sentiment Analysis of Customers’ Reviews Using a Hybrid Evolutionary SVM-Based Approach in an Imbalanced Data Distribution’, IEEE Access, vol. 10, pp. 22260–22273, 2022, doi: 10.1109/ACCESS.2022.3149482.

        [14] E. D. Madyatmadja, C. P. M. Sianipar, C. Wijaya, and D. J. M. Sembiring, ‘Classifying Crowdsourced Citizen Complaints through Data Mining: Accuracy Testing of k-Nearest Neighbors, Random Forest, Support Vector Machine, and AdaBoost’, Informatics, vol. 10, no. 4, p. 84, Dec. 2023, doi: 10.3390/informatics10040084.

        [15] S. Tam, R. B. Said, and O. O. Tanriover, ‘A ConvBiLSTM Deep Learning Model-Based Approach for Twitter Sentiment Classification’, IEEE Access, vol. 9, pp. 41283–41293, 2021, doi: 10.1109/ACCESS.2021.3064830.

        [16] R. Nagamanjula and A. Pethalakshmi, ‘A novel framework based on bi-objective optimization and LAN2FIS for Twitter sentiment analysis’, Soc. Netw. Anal. Min., vol. 10, no. 1, p. 34, Dec. 2020, doi: 10.1007/s13278-020-00648-5.

        [17] S. H. Janjua, G. F. Siddiqui, M. A. Sindhu, and U. Rashid, ‘Multilevel aspect based sentiment classification of Twitter data: using hybrid approach in deep learning’, PeerJ Computer Science, vol. 7, p. e433, Apr. 2021, doi: 10.7717/peerj-cs.433.

        [18] L. Chaudhary, N. Girdhar, D. Sharma, J. Andreu-Perez, A. Doucet, and M. Renz, ‘A Review of Deep Learning Models for Twitter Sentiment Analysis: Challenges and Opportunities’, IEEE Trans. Comput. Soc. Syst., vol. 11, no. 3, pp. 3550–3579, Jun. 2024, doi: 10.1109/TCSS.2023.3322002.

        [19] S. Barreto, R. Moura, J. Carvalho, A. Paes, and A. Plastino, ‘Sentiment analysis in tweets: an assessment study from classical to modern word representation models’, Data Min Knowl Disc, vol. 37, no. 1, pp. 318–380, Jan. 2023, doi: 10.1007/s10618-022-00853-0.

        [20] S. S. Jacob and R. Vijayakumar, ‘Sentimental analysis over twitter data using clustering based machine learning algorithm’, J Ambient Intell Human Comput, Jan. 2021, doi: 10.1007/s12652-020-02771-9.

        [21] K. Ayyub, S. Iqbal, E. U. Munir, M. W. Nisar, and M. Abbasi, ‘Exploring Diverse Features for Sentiment Quantification Using Machine Learning Algorithms’, IEEE Access, vol. 8, pp. 142819–142831, 2020, doi: 10.1109/ACCESS.2020.3011202.

        [22] M. AminiMotlagh, H. Shahhoseini, and N. Fatehi, ‘A reliable sentiment analysis for classification of tweets in social networks’, Soc. Netw. Anal. Min., vol. 13, no. 1, p. 7, Dec. 2022, doi: 10.1007/s13278-022-00998-2.

        [23] A. S. Talaat, ‘Sentiment analysis classification system using hybrid BERT models’, J Big Data, vol. 10, no. 1, p. 110, Jun. 2023, doi: 10.1186/s40537-023-00781-w.

        [24] C.-H. Lin and U. Nuha, ‘Sentiment analysis of Indonesian datasets based on a hybrid deep-learning strategy’, J Big Data, vol. 10, no. 1, p. 88, May 2023, doi: 10.1186/s40537-023-00782-9.

        [25] G. Manias, A. Mavrogiorgou, A. Kiourtis, C. Symvoulidis, and D. Kyriazis, ‘Multilingual text categorization and sentiment analysis: a comparative analysis of the utilization of multilingual approaches for classifying twitter data’, Neural Comput & Applic, vol. 35, no. 29, pp. 21415–21431, Oct. 2023, doi: 10.1007/s00521-023-08629-3.

        [26] A. Bello, S.-C. Ng, and M.-F. Leung, ‘A BERT Framework to Sentiment Analysis of Tweets’, Sensors, vol. 23, no. 1, p. 506, Jan. 2023, doi: 10.3390/s23010506.

        [27] B. Wang, D. Shan, A. Fan, L. Liu, and J. Gao, ‘A Sentiment Classification Method of Web Social Media Based on Multidimensional and Multilevel Modeling’, IEEE Trans. Ind. Inf., vol. 18, no. 2, pp. 1240–1249, Feb. 2022, doi: 10.1109/TII.2021.3085663.

        Downloads

        Published

        2025-11-11

        How to Cite

        Comparative Analysis of Machine Learning Algorithms for Indonesian Twitter Sentiment Classification on the Jakarta–Bandung High-Speed Rail Project. (2025). Bulletin of Intelligent Machines and Algorithms, 1(1), 7-13. https://doi.org/10.65780/bima.v1i1.3

        Most read articles by the same author(s)