A Comparative Analysis of Random Forest and Gradient Boosting Regression Techniques in Google Colab for Air Temperature Prediction in the Greater Accra Region, Ghana

Authors

  • Michael Stanley Peprah School of Mines and Built Environment, University of Energy and Natural Resources, Sunyani, Ghana
  • Abigail Odoom School of Mines and Built Environment, University of Energy and Natural Resources, Sunyani, Ghana
  • Edwin Kojo Larbi Geo-Informatics Division, Building and Road Research Institute, Kumasi, Ghana
  • Michael Angbang Mwin School of Mines and Built Environment, University of Energy and Natural Resources, Sunyani, Ghana

DOI:

https://doi.org/10.58825/jog.2026.20.1.259

Keywords:

Air Temperature Prediction, Random Forest, Gradient Boosting Regression, ARIMA, Machine Learning

Abstract

Accurate temperature prediction is essential for climate adaptation, environmental monitoring, and sustainable urban planning. This study evaluates the performance of two machine learning techniques Random Forest (RF) and Gradient Boosting Regression (GBR) for predicting near-surface air temperature in the Greater Accra Region of Ghana. Daily temperature observations obtained from the Ghana Meteorological Agency covering the period 1960–2018 were used for model development. The average daily air temperature was computed from minimum and maximum temperature observations. The predictive performance of the models was compared with a classical statistical time-series model, Autoregressive Integrated Moving Average (ARIMA). Model evaluation was performed using five-fold cross-validation to improve the robustness of the results. Performance metrics included Mean Squared Error (MSE) and the coefficient of determination (R²). The results show that the Random Forest model achieved the highest predictive accuracy with MSE = 0.0010 °C and R² = 0.9996, while the Gradient Boosting Regression model produced MSE = 0.0015 °C and R² = 0.9994. The ARIMA model showed significantly lower performance with MSE ≈ 0.598 °C and R² ≈ 0.30. The high predictive performance of the machine learning models is partly attributed to the deterministic relationship between the input variables and the computed target temperature. The study demonstrates the potential of machine learning approaches for climate-related prediction tasks and provides insights for environmental planning and climate resilience strategies in rapidly urbanizing regions such as Greater Accra.

References

Acheampong, R. A. 2021. “Accra: City Scoping Study.” African Cities Research Consortium:1–11.

Adu-Prah, S., S. Appiah-Opoku, and D. Aboagye. 2019. “Spatiotemporal Evidence of Recent Climate Variability in Ghana.” African Geographical Review 38(2):172–190.

Appeaning Addo, K. 2015. “Monitoring Sea Level Rise-Induced Hazards along the Coast of Accra in Ghana.” Natural Hazards 78(2):1293–1307.

Bessah, E., W. Amponsah, S. O. Ansah, A. Afrifa, B. Yahaya, C. S. Wemegah, et al. 2022. “Climatic Zoning of Ghana Using Selected Meteorological Variables for the Period 1976–2018.” Meteorological Applications 29(1):e2049.

Box, G. E. P., and G. M. Jenkins. 1976. Time Series Analysis: Forecasting and Control. Boca Raton, FL: Holden-Day.

Breiman, L. 2001. “Random Forests.” Machine Learning 45(1):5–32.

Darko, G., S. Bi, I. Sarfo, S. O. Y. Amankwah, F. E. Azeez, E. Yeboah, et al. 2022. “Impacts of Climate Hazards on Coastal Livelihoods in Ghana: The Case of Ningo-Prampram in the Greater Accra Region.” Environment, Development and Sustainability 24(1):1445–1474.

Fisher, A., C. Rudin, and F. Dominici. 2019. “All Models Are Wrong, but Many Are Useful: Learning a Variable’s Importance by Studying an Entire Class of Prediction Models Simultaneously.” Journal of Machine Learning Research 20(177):1–81.

Frimpong, B. F., and A. R. G. Asonomaso-Kwabre. 2022. Analysis of the Relationship between Spatial Urban Expansion and Temperature Utilizing Remote Sensing and GIS Techniques in the Accra and Kumasi Metropolises in Ghana. Doctoral dissertation, Brandenburgische Technische Universität Cottbus-Senftenberg.

Gupta, I., H. Mittal, D. Rikhari, and A. K. Singh. 2022. “MLRM: A Multiple Linear Regression Based Model for Average Temperature Prediction of a Day.” arXiv Preprint arXiv:2203.05835.

Heramb, P., K. V. Ramana Rao, A. Subeesh, and A. Srivastava. 2023. “Predictive Modelling of Reference Evapotranspiration Using Machine Learning Models Coupled with Grey Wolf Optimizer.” Water 15(5):856.

Holzman, M., A. Srivastava, R. Rivas, and A. Huete. 2025. “Evaluating the Relationship between Vegetation Status and Soil Moisture in Semi-Arid Woodlands, Central Australia, Using Daily Thermal, Vegetation Index, and Reflectance Data.” Remote Sensing 17(4).

Kumar, M., Y. Agrawal, S. Adamala, Pushpanjali, A. V. M. Subbarao, V. K. Singh, and A. Srivastava. 2024. “Generalization Ability of Bagging and Boosting Type Deep Learning Models in Evapotranspiration Estimation.” Water 16(16):2233.

Kumar, U., Rashmi, A. Srivastava, H. V. Parmar, H. H. Mashru, P. A. Pandya, et al. 2025. “Modelling Soil Temperature at Multiple Depths in Saurashtra Region (Junagadh) of Gujarat Using Machine Learning and Shapely Approach.” Discover Applied Sciences 7(9):981.

Li, Z., S. Bi, S. Hao, and Y. Cui. 2022. “Aboveground Biomass Estimation in Forests with Random Forest and Monte Carlo-Based Uncertainty Analysis.” Ecological Indicators 142:109246.

Niu, L., R. Tang, Y. Jiang, and X. Zhou. 2019. “Spatio-Temporal Patterns and Drivers of the Surface Urban Heat Island in 36 Major Cities in China: A Comparison of Two Different Methods for Delineating Rural Areas.” Sustainability 12:478.

Ortiz-García, E. G., S. Salcedo-Sanz, and C. Casanova-Mateo. 2014. “Accurate Precipitation Prediction with Support Vector Classifiers: A Study Including Novel Predictive Variables and Observational Data.” Atmospheric Research 139:128–136.

Padi, M., B. A. K. Foli, E. S. Nyadjro, K. Owusu, and G. Wiafe. 2022. “Extreme Rainfall Events over Accra, Ghana, in Recent Years.” Remote Sensing in Earth Systems Sciences 5(1):71–82.

Romilly, P. 2005. “Time Series Modelling of Global Mean Temperature for Managerial Decision-Making.” Journal of Environmental Management 76:61–70.

Shams, M. Y., Z. Tarek, A. M. Elshewey, M. Hany, A. Darwish, and A. E. Hassanien. 2023. “A Machine Learning-Based Model for Predicting Temperature under the Effect of Climate Change.” Pp. 61–81 in The Power of Data: Driving Climate Change with Data Science and Artificial Intelligence Innovations, edited by A. E. Hassanien and A. Darwish. Studies in Big Data, Vol. 118. https://doi.org/10.1007/978-3-031-22456-0-4

Shu, Y., K. Zhang, H. Duan, and L. Wu. 2026. “Simulation Method for Considering the Lag of Turbulent Evapotranspiration.” Ecohydrology 19(1):e70184.

Sibindi, R., R. W. Mwangi, and A. G. Waititu. 2023. “A Boosting Ensemble Learning-Based Hybrid Light Gradient Boosting Machine and Extreme Gradient Boosting Model for Predicting House Prices.” Engineering Reports 5(4):e12599.

Wang, L., J. Kong, Q. Zhang, and Y. Zhong. 2025. “A Dual-Source Energy Balance Model-Assisted Ensemble Learning Approach for Estimating Latent Heat Flux.” Theoretical and Applied Climatology 156(7):399.

Waylen, P., and K. Owusu. 2014. “Changes in Expectations and Extremes in the Rainfall Climatology of Accra, Ghana, 1895–2005.” Applied Geography 52:99–109.

Wemegah, C. S., E. I. Yamba, J. N. Aryee, F. Sam, and L. K. Amekudzi. 2020. “Assessment of Urban Heat Island Warming in the Greater Accra Region.” Scientific African 8:e00426.

Zhang, B., H. Yu, Z. Hu, P. Yue, Z. Tang, H. Luo, et al. 2025. “A Machine Learning-Based Observational Constraint Correction Method for Seasonal Precipitation Prediction.” Advances in Atmospheric Sciences 42(1):36–52.

Zhou, Z., C. Qiu, and Y. Zhang. 2023. “A Comparative Analysis of Linear Regression, Neural Networks and Random Forest Regression for Predicting Air Ozone Employing Soft Sensor Models.” Scientific Reports 13(1):22420.

Zounemat-Kermani, M., and M. Kheimi. 2025. “Ensemble Boosting Methods for Surface Water Quality Modeling: A Review.” Archives of Computational Methods in Engineering:1–38.

Downloads

Published

2026-05-04

How to Cite

[1]
M. S. Peprah, A. Odoom, E. K. Larbi, and M. A. Mwin, “A Comparative Analysis of Random Forest and Gradient Boosting Regression Techniques in Google Colab for Air Temperature Prediction in the Greater Accra Region, Ghana”, Journal of Geomatics, vol. 20, no. 1, pp. 55–60, May 2026.