Comparison of Long Short-Term Memory (LSTM) and XGBoost Algorithms in Predicting Air Quality in Jakarta

Authors

  • Luthfi radyansyah Fakultas Ilmu Komputer
  • Nizirwan Universitas Esa Unggul https://orcid.org/0000-0003-1189-9093
  • Riya Widayanti Departemen of Informatic Engineering, Faculty of Computer Science University of Esa Unggul
  • Rahmat Budiarsa Departemen of Informatic Engineering, Faculty of Computer Science University of Esa Unggul

DOI:

https://doi.org/10.25181/rt.v4i2.5013

Keywords:

Air Quality, Pollution, LSTM, XGBoost, Confusion Matrix

Abstract

This study compares the Extreme Gradient Boosting (XGBoost) and Long Short-Term Memory (LSTM) algorithms in predicting air quality in Jakarta using the Air Pollution Standard Index (ISPU) dataset. The dataset consists of 2,874 observations collected from January 1, 2024, to July 31, 2025. The results show that both models are capable of producing accurate predictions; however, XGBoost demonstrates superior performance. XGBoost achieves an RMSE of 1.9704, MAE of 1.0509, MAPE of 1.54%, and an R² of 0.9913. In contrast, LSTM produces an RMSE of 3.0667, MAE of 2.0968, MAPE of 3.71%, and an R² of 0.9790. These findings indicate that XGBoost has lower prediction error and a stronger ability to explain data variability. Additionally, particulate pollutants such as PM2.5 and PM10 are identified as the dominant factors influencing air quality. Overall, XGBoost proves to be more effective, stable, and efficient in modeling air quality data.

Downloads

Download data is not yet available.

References

[1] M. Yasir, “Pencemaran Udara Di Perkotaan Berdampak Bahaya Bagi Manusia, Hewan, Tumbuhan dan Bangunan”, OSF Prepr., pp. 1–10, 2021. doi: 10.31219/osf.io/nc5rg.

[2] L. Bai, J. Wang, X. Ma, and H. Lu, “Air Pollution Forecasts: An Overview”, Int. J. Environ. Res. Public Health, vol. 15, no. 4, p. 780, 2018. doi: 10.3390/ijerph15040780.

[3] D. R. Widiana, E. F. Rahmawati, S. F. I. Abdillah, S.-J. You, D. Dermawan, and Y.-F. Wang, “Reconstructing air quality index in metropolitan cities via predictive machine learning approach: A case study in Jakarta and Surabaya, Indonesia”, Atmos. Pollut. Res., p. 103049, 2026. doi: 10.1016/j.apr.2026.103049.

[4] U. Syapotro, S. Ratna, M. Muflih, H. Budiman, M. R. Noor Ridha, and M. Hamdani, “Prediction of Jakarta’s Air Quality Using a Stacking Framework of CLSTM, CatBoost, SVR, and XGBoost”, J. Data Sci., vol. 2024, no. SE-Articles, Nov. 2024. https://iuojs.intimal.edu.my/index.php/jods/article/view/586.

[5] N. Salsabila, D. Kuswardani, and R. R. A. Siregar, “Prediksi kualitas udara di Jakarta menggunakan metode long short-term memory (LSTM)”, Repository Institut Teknologi PLN. 2025. https://repository.itpln.ac.id/id/eprint/2301.

[6] Y. Faeni, A. Astasia, and M. Riadi, “Pengaruh parameter meteorologi terhadap penurunan kasus COVID-19 di DKI Jakarta”, Seminar Nasional Official Statistics 2020, no. 1. pp. 132–137, 2021. doi: 10.34123/semnasoffstat.v2020i1.628.

[7] M. A. Farahani, F. El Kalach, A. Harper, M. R. McCormick, R. Harik, and T. Wuest, “Time-series forecasting in smart manufacturing systems: An experimental evaluation of the state-of-the-art algorithms”, Robot. Comput. Integr. Manuf., vol. 95, no. February, p. 103010, 2025. Doi: 10.1016/j.rcim.2025.103010.

[8] N. Agustina et al., “Pengantar Data Science: Teori, Teknik, dan Aplikasinya di Era Digital”, Yashmedia, Yogyakarta, Indonesia: Yashmedia, 2025. ISBN 978-623-89711-4-5.

[9] I. M. Rajagukguk, R. Hartanto, Julian, and R. Halim, “Comparative Analysis of XGBoost, Random Forest, and Logistic Regression for Classifying Jakarta’s Air Pollution Index (ISPU)”, Procedia Comput. Sci., vol. 269, pp. 108–120, 2025. doi: 10.1016/j.procs.2025.08.264.

[10] I. Malashin, V. Tynchenko, A. Gantimurov, and V. Nelyub, “Applications of Long Short-Term Memory (LSTM) Networks in Polymeric Sciences : A Review”, Polymers (Basel)., vol. 16, no. 18, pp. 1–44, 2024. doi: 10.3390/polym16182607.

[11] W. Lu, J. Li, Y. Li, A. Sun, and J. Wang, “A CNN-LSTM-Based Model to Forecast Stock Prices”, Complexity, vol. 2020, no. 1, pp. 1–10, 2020. doi: 10.1155/2020/6622927.

[12] F. Baldo, S. Catarina, Y. Yamada, C. Santa, and C. State, “Adaptive Fast XGBoost for Multiclass Classification”, J. Inf. Data Manag., vol. 14, no. 1, pp. 1–10, 2023. doi: 10.5753/jidm.2023.3150.

[13] A. Fauzihan, B. Sajiwo, B. Rahmat, and A. Junaidi, “Klasifikasi indeks standar pencemaran udaran (ISPU) menggunakan algoritma XGBoost dengan teknik imbalanced data (SMOTE)”, JITET (Jurnal Inform. Tek. Elektro Ter., vol. 12, no. 3, 2024. doi: 10.23960/jitet.v12i3.4699.

[14] S. E. Herni, Yulianti, O. O. Soesanto, and Y. Sukmawaty, “Penerapan Metode Extreme Gradient Boosting (XGBOOST) pada Klasifikasi Nasabah Kartu Kredit”, J. Math. Theory Appl., 2022. doi: 10.31605/jomta.v4i1.1792.

[15] Doreswamy, K. S. Harishkumar, K. M. Yogesh, and I. Gad, “Forecasting Air Pollution Particulate Matter (PM2.5) Using Machine Learning Regression Models”, Procedia Comput. Sci., vol. 171, pp. 2057–2066, 2020. doi: 10.1016/j.procs.2020.04.221.

[16] W. Taqiyudin, D. Safitri, and Sujarwo, “Analisis Dampak Polusi Di Jakarta Bagi Keberlangsungan Hidup Masyarakat”, J. Intelek Insa. Cendikia, vol. 2, no. 4, pp. 7533–7537, 2025. https://jicnusantara.com/index.php/jiic.

[17] E. Mustika Sari, C. Sabila, R. Fakhrizal Adam, and R. Kurniawan, “Analisis dan Prediksi Indeks Kualitas Udara Jakarta: Penerapan Algoritma XGBoost”, J. Nas. Teknol. dan Sist. Inf., vol. 11, no. 2, pp. 161–169, Sep. 2025. doi: 10.25077/TEKNOSI.v11i2.2025.161-169.

[18] T. Handhayani, “An integrated analysis of air pollution and meteorological conditions in Jakarta”, Sci. Rep., pp. 1–11, 2023. doi: 10.1038/s41598-023-32817-9.

[19] Kementerian Lingkungan Hidup dan Kehutanan Republik Indonesia, Peraturan Menteri Lingkungan Hidup dan Kehutanan Republik Indonesia Nomor P.14/MENLHK/SETJEN/KUM.1/7/2020 tentang Indeks Standar Pencemar Udara. Jakarta, Indonesia: Kementerian Lingkungan Hidup dan Kehutanan Republik Indonesia, 2020. [Online]. Tersedia: https://www.peraturan.go.id/id/permen-lhk-no-p-14-menlhk-setjen-kum-1-7-2020-tahun-2020.

Downloads

Published

2026-07-15

Issue

Section

Articles