XGBOOST-BASED SENTIMENT ANALYSIS OF MACROECONOMIC POLICY YOUTUBE COMMENTS
DOI:
https://doi.org/10.47701/dsqzcs54Keywords:
sentiment analysis, XGBoost, TF-IDF, YouTube comments, macroeconomic policyAbstract
Public reaction to macroeconomic policy is increasingly expressed through YouTube comment sections, yet this unstructured text is rarely used to gauge sentiment toward government decisions such as exchange-rate management. This study builds and evaluates an XGBoost-based classifier to automatically label the sentiment of YouTube comments discussing Indonesia's macroeconomic policy, particularly the depreciation of the Rupiah. A dataset of 17,838 manually labeled Indonesian-language comments (positive, negative, neutral) was collected and preprocessed through case folding, text cleaning, Indonesian stopword removal, and stemming using the Sastrawi library, then represented as 5,000-dimensional TF-IDF feature vectors. An XGBoost multi-class classifier was trained on an 80:20 stratified train-test split. The model achieved an overall accuracy of 85.68%, with the highest F1-score obtained for the neutral class (0.90) and a comparatively lower recall for the positive class (0.70) due to class imbalance. Word cloud visualization revealed that terms such as “pemerintah,” “rupiah,” and “ekonomi” dominated across all sentiment classes, while “melemah” and “krisis” distinctly marked negative sentiment. These findings demonstrate that XGBoost combined with TF-IDF is an effective and computationally efficient approach for monitoring public sentiment toward macroeconomic policy on social media.
References
Adilla, R. E., Huda, M., Aziz, M., & Suadaa, L. H. (2024). Aspect-Based Sentiment Analysis of Transportation Electrification Opinions on YouTube Comment Data. Jurnal Aplikasi Statistika & Komputasi Statistik, 16(2). https://doi.org/10.34123/jurnalasks.v16i2.790
Alnofeli, K. K., Akter, S., Yanamandram, V., & Hani, U. (2026). AI-powered CRM capability model: Advancing marketing ambidexterity, profitability and competitive performance. International Journal of Information Management, 86. https://doi.org/10.1016/j.ijinfomgt.2025.102981
Angdresey, A., Sitanayah, L., & Tangka, I. L. H. (2025). Sentiment Analysis for Political Debates on YouTube Comments using BERT Labeling, Random Oversampling, and Multinomial Naïve Bayes. Journal of Computing Theories and Applications, 2(3). https://doi.org/10.62411/jcta.11668
Guo, K., Shen, C., Zhou, X., Ren, S., Hu, M., Shen, M., Chen, X., & Guo, H. (2024). Traffic Data-Empowered XGBoost-LSTM Framework for Infectious Disease Prediction. IEEE Transactions on Intelligent Transportation Systems, 25(1). https://doi.org/10.1109/TITS.2022.3172206
Hadi Arfian, M., Sofu Maruhawa, H., Aisyah Putri, A., Ratulugina, D., Ridzky Khoirunnisa, E., Hermawan, V., & Julaibib Syahr, A. (2025). Analisis Sentimen Pada Media Sosial Menggunakan Metode Support Vector Machine. Jurnal Ilmu Teknik Dan Komputer, 09(01).
Hama Aziz, R. H., & Dimililer, N. (2021). SentiXGboost: enhanced sentiment analysis in social media posts with ensemble XGBoost classifier. Journal of the Chinese Institute of Engineers, Transactions of the Chinese Institute of Engineers,Series A, 44(6). https://doi.org/10.1080/02533839.2021.1933598
Kemp, S. (2025). Digital 2025: global advertising trends. Datareportal.
Le Dong Xuan, M. N., Thi Ngoc Bich, M. N., & Bao Phat, T. V. B. P. (2026). MEASURING THE IMPACT OF NON-TARIFF MEASURES ON VIETNAM’S AGRICULTURAL AND FRUIT EXPORTS IN THE CONTEXT OF IMPLEMENTING NEW GENERATION FTAS: APPLYING THE GRAVITY MODEL. International Journal of Leadership and Management. https://doi.org/10.65176/ijlm.v2i2.01
Le, H. S., Do, T. V. H., Nguyen, M. H., Tran, H. A., Pham, T. T. T., Nguyen, N. T., & Nguyen, V. H. (2024). Predictive model for customer satisfaction analytics in E-commerce sector using machine learning and deep learning. International Journal of Information Management Data Insights, 4(2). https://doi.org/10.1016/j.jjimei.2024.100295
Ma’aly, A. N., Pramesti, D., Fathurahman, A. D., & Fakhrurroja, H. (2024). Exploring Sentiment Analysis for the Indonesian Presidential Election Through Online Reviews Using Multi-Label Classification with a Deep Learning Algorithm. Information (Switzerland), 15(11). https://doi.org/10.3390/info15110705
Mandhasiya, D. G., Murfi, H., & Bustamam, A. (2024). The hybrid of BERT and deep learning models for Indonesian sentiment analysis. Indonesian Journal of Electrical Engineering and Computer Science, 33(1). https://doi.org/10.11591/ijeecs.v33.i1.pp591-602
Moghadamnejad, A., Moghaddasi, M. A., Hamidia, M., Mohammadi, R. K., & Zare, M. (2026). Ranking Earthquake Prediction Algorithms: A Comprehensive Review of Machine Learning and Deep Learning Methods. In Soil Dynamics and Earthquake Engineering (Vol. 200). https://doi.org/10.1016/j.soildyn.2025.109740
Mohapatra, S., Mukherjee, R., Roy, A., Sengupta, A., & Puniyani, A. (2022). Can Ensemble Machine Learning Methods Predict Stock Returns for Indian Banks Using Technical Indicators? Journal of Risk and Financial Management, 15(8). https://doi.org/10.3390/jrfm15080350
Mustofa, A., & Novita, R. (2022). Klasifikasi Sentimen Masyarakat Terhadap Pemberlakuan Pembatasan Kegiatan Masyarakat Menggunakan Text Mining Pada Twitter. Building of Informatics, Technology and Science (BITS), 4(1). https://doi.org/10.47065/bits.v4i1.1628
Pardede, E. T., Tania, K. D., & Afrina, M. (2026). Knowledge Discovery: Analisis Sentimen dan Emosi WhatsApp Business dengan Machine learning dan Deep Learning. Jurnal Nasional Teknologi Dan Sistem Informasi, 11(3). https://doi.org/10.25077/teknosi.v11i3.2025.310-318
Patil, R., Boit, S., Gudivada, V., & Nandigam, J. (2023). A Survey of Text Representation and Embedding Techniques in NLP. IEEE Access, 11. https://doi.org/10.1109/ACCESS.2023.3266377
Pratiwi, N., Hartanti, D., & Arum Sari, A. (2025). Sistem Rekomendasi Pemilihan Laptop Menggunakan Metode Content-Based Filtering Berbasis Spesifikasi Produk. Infotek: Jurnal Informatika Dan Teknologi, 8(2). https://doi.org/10.29408/jit.v8i2.30618
sabbah Naiarni panjaitana, Azzikrarairyahannum, Syahilatuzzahira, P. I. (2024). Sentimen Analisis Pengguna Media Sosial Berdasarkan Metode Ekstraksi Fitur dan Klasifikasi. Jurnal Ilmu Komputer, 16(2).
Samih, A., Ghadi, A., & Fennan, A. (2023). Enhanced sentiment analysis based on improved word embeddings and XGboost. International Journal of Electrical and Computer Engineering, 13(2). https://doi.org/10.11591/ijece.v13i2.pp1827-1836
Sari, A. A., & Sari, O. K. (2026). Pendekatan Interpretable Machine Learning untuk Analisis Keberhasilan Kampanye Pemasaran Menggunakan CatBoost dan SHAP. 9(2). https://doi.org/https://doi.org/10.29408/jit.v9i2.34715
Sari, O. K., & Cherid, A. (2023). Aplikasi Berbasis Web Menggunakan Apriori Untuk Rekomendasi Bundling Produk Sembako. Bit (Fakultas Teknologi Informasi Universitas Budi Luhur), 20(2). https://doi.org/10.36080/bit.v20i2.2444
Setyawan, Y. A., Nastiti, F. E., & Sari, A. A. (2025). Analisis Sentimen Ulasan Tempat Wisata Umbul Sigedang Di Google Maps Menggunakan Algoritma Naive Bayes. Smart Comp :Jurnalnya Orang Pintar Komputer, 14(2).
Shivsharan, N., Kambli, V., Dabholkar, S., Dalvi, A., & Sukali, T. (2025). Evaluating Machine Learning Models for Sentiment Analysis of YouTube Comments and Creating an Accessible Web Application for Comment Analysis. Procedia Computer Science, 258. https://doi.org/10.1016/j.procs.2025.04.574
Tangkudung, A. G. D., Rante, J. Z., Pakpahan, M., Putri, A., Puteri, A., Pribadi, D., Gosita, D. R., Rustandi, J., CPR, J. J., Ghalib, K., Farieanna, R., Purnawirawati, S., Setiawan, S., & Bassuni, W. (2024). INOVASI BISNIS PARIWISATA INDONESIA PASCA PANDEMI COVID-19. Dinamika: Jurnal Manajemen Sosial Ekonomi, 4(1). https://doi.org/10.51903/dinamika.v4i1.433
Tsiourlini, M., Tzafilkou, K., Karapiperis, D., & Tjortjis, C. (2024). Text Analytics on YouTube Comments for Food Products. Information (Switzerland), 15(10). https://doi.org/10.3390/info15100599
.