Perbandingan Performa Algoritma Random Forest dan XGBoost dalam Memprediksi Hujan di Area Gunung Ungaran

Authors

  • Arizal Irsyad Imanullah Universitas Dian Nuswantoro, Semarang
  • Ahmad Zainul Fanani Universitas Dian Nuswantoro, Semarang

DOI:

https://doi.org/10.30865/jurikom.v13i1.9416

Keywords:

Random Forest, XGBoost, Smote, Rainfall Prediction

Abstract

Hiking activities in Mount Ungaran are frequently hindered by extreme and unpredictable weather changes, which potentially endanger the safety of hikers. One of the primary challenges in developing an automated rainfall prediction model for this region is the class imbalance in historical meteorological data, where the number of non-rainy days significantly dominates rainfall events. This condition often causes machine learning models to become biased toward the majority class, leading to a failure in detecting actual rainfall events (false negatives). This study aims to address this issue through a comparative analysis of the performance of two popular ensemble algorithms, namely Random Forest and Extreme Gradient Boosting (XGBoost). Specifically, this research investigates the impact of applying the Synthetic Minority Oversampling Technique (SMOTE) to balance the training data distribution in order to enhance minority class detection accuracy. Using the ERA5 reanalysis daily dataset for the 2019–2023 period with input variables including temperature, humidity, air pressure, and wind speed, the models were trained and validated using a time-based split method with an 80:20 ratio. Performance evaluation was conducted comprehensively using accuracy, precision, recall, and F1-score metrics. The results provide strong empirical evidence that the application of SMOTE yields the most optimal impact on the XGBoost algorithm. The combined XGBoost-SMOTE model successfully achieved the best performance with an accuracy of 80.50% and an F1-score of 83.23%, outperforming the Random Forest model which remained at an accuracy of 78.21%. In conclusion, the integration of boosting methods with data resampling techniques proves to be highly effective in improving rainfall prediction reliability in regions with complex topography.

References

[1] R. Torhino and N. Andono, “Penerapan Algoritma Random Forest dalam Prediksi Curah Hujan untuk Mendukung Analisis Cuaca,” Technology and Science (BITS), vol. 6, no. 3, pp. 1688–1699, 2024, doi: 10.47065/bits.v6i3.6404.

[2] Z. A. Dwiyanti and C. Prianto, “Prediksi Cuaca Kota Jakarta Menggunakan Metode Random Forest,” Jurnal Tekno Insentif, vol. 17, no. 2, pp. 127–137, Oct. 2023, doi: 10.36787/jti.v17i2.1136.

[3] D. Sangaji and T. Sutabri, “Analisis XGBoost dan Random Forest untuk Prediksi Curah Hujan dalam Mendukung Mitigasi Karhutla,” Jurnal Pustaka AI (Pusat Akses Kajian Teknologi Artificial Intelligence), vol. 5, no. 1, pp. 13–18, Apr. 2025, doi: 10.55382/jurnalpustakaai.v5i1.905.

[4] M. Taqiyuddin and T. Bayu Sasongko, “Prediksi Cuaca Kabupaten Sleman Menggunakan Algoritma Random Forest,” JURNAL MEDIA INFORMATIKA BUDIDARMA, vol. 8, no. 3, p. 1683, Jul. 2024, doi: 10.30865/mib.v8i3.7897.

[5] A. Syahreza, N. K. Ningrum, and M. A. Syahrazy, “Perbandingan Kinerja Model Prediksi Cuaca: Random Forest, Support Vector Regression, dan XGBoost,” Edumatic: Jurnal Pendidikan Informatika, vol. 8, no. 2, pp. 526–534, Dec. 2024, doi: 10.29408/edumatic.v8i2.27640.

[6] A. Fauziah, H. Hermanto, and M. Akbar Sukmarini, “Extreme Gradient Boosting pada Peramalan Pola Curah Hujan Bulanan Kabupaten Banyuwangi,” 2024.

[7] A. Hot Iman, F. Ready Permana, G. Putro Wardana, R. Kemmy Rachmansyah, and M. Mega Santoni, “Perbandingan Algoritma Klasifikasi Random Forest dan Extreme Gradient Boosting pada Dataset Cuaca Provinsi DKI Jakarta Tahun 2018,” 2022, [Online]. Available: https://katalog.data.go.id/dataset/data-prakiraan-cuaca-wilayah-provinsi-dki-jakarta-tahun-2018.

[8] A. Suaif and E. Sylvianti Rahayu, “ANALISIS FAKTOR DAN POLA KEJADIAN BANJIR DI BANDAR LAMPUNG MENGGUNAKAN ARIMA, RANDOM FOREST, DAN XGBOOST,” 2025.

[9] R. Irfannandhy, L. B. Handoko, and N. Ariyanto, “Analisis Performa Model Random Forest dan CatBoost dengan Teknik SMOTE dalam Prediksi Risiko Diabetes,” Edumatic: Jurnal Pendidikan Informatika, vol. 8, no. 2, pp. 714–723, Dec. 2024, doi: 10.29408/edumatic.v8i2.27990.

[10] R. K. Rachmansyah and R. Astriratma, “Implementasi Algoritma Extra Trees Untuk Klasifikasi Cuaca Provinsi Dki Jakarta Dengan Oversampling SMOTE,” 2023. [Online]. Available: https://pypi.org.

[11] M. Alfian Fadillah and E. Dewi Sri Mulyani, “Komparasi Algoritma C4.5, Naive Bayes, K-Nearest Neighbor, Random Forest Untuk Prediksi Faktor Penyebab Penyakit Diabetes A B S T R A K I N F O A R T I K E L,” 2024. [Online]. Available: https://ejournal.upi.edu/index.php/IJDB

[12] H. Hersbach et al., “The ERA5 global reanalysis,” Quarterly Journal of the Royal Meteorological Society, vol. 146, no. 730, pp. 1999–2049, Jul. 2020, doi: 10.1002/qj.3803.

[13] J. Zhang et al., “Evaluation of Surface Relative Humidity in China from the CRA-40 and Current Reanalyses,” Adv Atmos Sci, vol. 38, no. 11, pp. 1958–1976, Nov. 2021, doi: 10.1007/s00376-021-0333-6.

[14] A. Luthfiarta, A. Febriyanto, H. Lestiawan, and W. Wicaksono, “Analisa Prakiraan Cuaca dengan Parameter Suhu, Kelembaban, Tekanan Udara, dan Kecepatan Angin Menggunakan Regresi Linear Berganda,” JOINS (Journal of Information System), vol. 5, no. 1, pp. 10–17, May 2020, doi: 10.33633/joins.v5i1.2760.

[15] M. Dewi et al., “JIP (Jurnal Informatika Polinema) PENERAPAN SMOTE-NCL UNTUK MENGATASI KETIDAKSEIMBANGAN KELAS PADA KLASIFIKASI PENYAKIT JANTUNG KORONER,” 2023.

[16] F. Fadmadika, H. H. Handayani, T. Al Mudzakir, and J. Indra, “PENGARUH SMOTE TERHADAP PERFORMA ALGORITMA RANDOM FOREST DAN ALGORITMA GRADIENT BOOSTING DALAM MEMPREDIKSI PENYAKIT STROKE,” Jurnal Teknik Informasi dan Komputer (Tekinkom), vol. 7, no. 2, p. 837, Dec. 2024, doi: 10.37600/tekinkom.v7i2.1575.

[17] D. Husen, D. Sandi, and S. Bumbungan, “Analisis Prediksi Kebakaran Hutan dengan Menggunakan Algoritma Random Forest Classifier,” vol. 16, no. 1, 2022, [Online]. Available: https://journal.uniku.ac.id/index.php/ilkom

[18] G. Fibarkah et al., Prediksi Curah Hujan di Kabupaten Rembang dengan Model Random Forest, vol. 4, no. 1. 2023. [Online]. Available: https://webapi.bps.go.id/v1/api/list/model/data/lang/ind/domain/3317/var/488

[19] T. Mahesti, K. D. Hartomo, and S. Y. J. Prasetyo, “Penerapan Algoritma Random Forest dalam Menganalisa Perubahan Suhu Permukaan Wilayah Kota Salatiga,” JURNAL MEDIA INFORMATIKA BUDIDARMA, vol. 6, no. 4, p. 2074, Oct. 2022, doi: 10.30865/mib.v6i4.4603.

[20] M. Hermansyah, A. Saikhu, and B. Amaliah, “PEMODELAN DATA RADIOSONDE MENGGUNAKAN STACKING ENSEMBLE UNTUK KLASIFIKASI HUJAN,” JIPI (Jurnal Ilmiah Penelitian dan Pembelajaran Informatika), vol. 10, no. 2, pp. 1678–1687, May 2025, doi: 10.29100/jipi.v10i2.7806.

[21] D. D. N. Cahyo and A. Sunyoto, “Analisis Perbandingan Klasifikasi dalam Data Mining pada Prediksi Hujan dengan menggunakan Algoritma LSTM dan GRU,” Jurnal Sains dan Informatika, vol. 11, no. 1, pp. 40–49, Jun. 2025, doi: 10.34128/jsi.v11i1.1212.

[22] W. Indrasari and H. Suhendar, “ANALISIS MODEL PREDIKSI CUACA MENGGUNAKAN SUPPORT VECTOR MACHINE, GRADIENT BOOSTING, RANDOM FOREST, DAN DECISION TREE,” Prosiding Seminar Nasional Fisika (E-Journal), vol. XII, 2024, doi: 10.21009/03.1201.FA18.

[23] G. Ashari Rakhmat and W. Mutohar, “MIND (Multimedia Artificial Intelligent Networking Database Prakiraan Hujan menggunakan Metode Random Forest dan Cross Validation,” Journal MIND Journal | ISSN, vol. 8, no. 2, pp. 173–187, 2023, doi: 10.26760/mindjournal.v8i2.173-187.

[24] N. A. Prakoso Indaryono, “ANALISA PERBANDINGAN ALGORITMA RANDOM FOREST DAN NAÏVE BAYES UNTUK KLASIFIKASI CURAH HUJAN BERDASARKAN IKLIM DI INDONESIA,” JIPI (Jurnal Ilmiah Penelitian dan Pembelajaran Informatika), vol. 9, no. 1, pp. 158–167, Feb. 2024, doi: 10.29100/jipi.v9i1.4421.

Additional Files

Published

2026-02-28

How to Cite

Arizal Irsyad Imanullah, & Ahmad Zainul Fanani. (2026). Perbandingan Performa Algoritma Random Forest dan XGBoost dalam Memprediksi Hujan di Area Gunung Ungaran. JURNAL RISET KOMPUTER (JURIKOM), 13(1), 192–201. https://doi.org/10.30865/jurikom.v13i1.9416