Frost prediction model with XGBoost integrated into real-time meteorological APIs for high Andean areas of Peru
Main Article Content
Abstract
Frost represents one of the main climatic risks for agriculture in the high Andean areas of Peru, due to its direct impact on agricultural productivity and food security for rural populations. In response to this situation, the problem was addressed by evaluating the performance of a machine learning model based on XGBoost with the aim of predicting frost events, integrating historical and real-time meteorological data. The analysis was performed using a dataset consisting of 1,672,825 observations over 25 years from eleven high Andean regions, obtained from SENAMHI and the NASA POWER platform, which was subjected to cleaning, integration, and balancing processes. The model was trained with 80% of the data and evaluated with the remaining 20% using a stratified validation scheme, employing metrics such as accuracy, precision, recall, F1-score, and AUC-ROC. The results show outstanding performance, with an accuracy of 95.17% and an AUC-ROC of 0.9938, demonstrating a high capacity to detect frost events even in unbalanced class scenarios. Finally, the implementation of the model in a real-time prediction system with meteorological APIs and its visualization through an interactive dashboard demonstrate its potential as a support tool for early warning systems and agricultural risk management in high Andean areas.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
When an author creates an article and publishes it in a journal, the copyright passes to the journal as part of the publishing agreement. Therefore, the journal becomes the owner of the rights to reproduce, distribute and sell the article. The author retains some rights, such as the right to be recognized as the creator of the article and the right to use the article for his or her own scholarly or research purposes, unless otherwise agreed in the publication agreement.
How to Cite
References
SENAMHI, «PLATAFORMA DE ESTADO PERUANO,» 2025. [En línea]. Available: https://www.senamhi.gob.pe/?p=heladas-y-friajes-preguntas.
R. R. A. S. Caminada Vallejo, «El eterno retorno del fenómeno de las heladas en el Perú: ¿Existen adecuadas políticas para combatir dicho fenómeno en el Perú?,» ALICIA, 2015.
ComexPerú, «ComexPerú.com,» 5 julio 2024. [En línea]. Available: https://www.comexperu.org.pe/articulo/mas-de-un-millon-de-hectareas-agricolas-en-riesgo-por-heladas.
P. y. R. d. R. d. D. (. Centro Nacional de Estimación, «ESCENARIOS DE RIESGO POR HELADAS Y FRIAJES EN EL MARCO DEL PLAN MULTISECTORIAL 2025 - 2027,» Lima, 2024.
S. N. d. M. e. H. d. Perú., «Temporada de bajas temperaturas 2024.,» 2024. [En línea]. Available: https://www.gob.pe/institucion/senamhi/campanas/1281-temporada-de-bajas-temperaturas-2022.
E. Zegarra, «Heladas y perfil de riesgo de los agricultores peruanos (Working paper).,» GRADE, 2019.
L. J. L. V. C. G. C. A. H. D. R. R. O. G.-R. Evelin Zarate Aller, «Efecto de las bajas temperaturas en la selección por tolerancia para progenies hibridas de papa (Solanum sp.) con introgresión de Solanum commersonii., en la Comunidad de Occopata, Cusco,» Revista de Investigaciones Altoandinas, 30 Abril 2023.
J. A. C. Robinson Castillo Méndez, «Desarrollo de un modelo de machine learning para determinar el comportamiento de heladas en la Sabana de Bogotá,» Vía Innova, 2024.
S. N. d. M. e. H. d. P. Perú., «Atlas de heladas del Perú,» IDESEP, 2010.
J. &. K. H. Lee, «Prediction of Frost Occurrences Using Statistical Modeling Approaches.,» DOAJ, 2016.
L. A. S. P. C. Monteiro, «Assessment of NASA/POWER satellite‐based weather system for Brazilian conditions and its impact on sugarcane yield simulation.,» International Journal of Climatology, pp. 1571-1581, 2018.
T. &. G. C. Chen, «XGBoost: A scalable tree boosting system.,» Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, p. 785–794, 2016.
D. R. M. &. P. J. Torres, «Performance improvement in meteorological forecasting using optimized XGBoost models.,» Environmental Modelling & Software, pp. 156-168, 2022.
J. H. Friedman, «Greedy function approximation: A gradient boosting machine.,» Annals of Statistics, p. 1189–1232, 2001.
G. S. K. &. W. Y. Zhang, «Evaluation of machine learning methods for meteorological prediction tasks.,» Atmospheric Research, pp. 105-155, 2021.
X. L. Y. &. Z. M. Qian, «Real-time meteorological prediction using gradient boosting and sensor networks.,» Sensors, pp. 52-81, 2022.
M. Á. G. Navarro, «Construcción de un modelo eficiente de predicción de heladas en entornos locales mediante técnicas del análisis inteligente en contextos iot,» Dialnet, pp. 18-21, 2021.
H. &. A. S. Aboelkhair, «Assessment of agroclimatology NASA POWER reanalysis datasets for temperature types and relative humidity at 2 m against ground observations over Egypt.,» Advances in Space Research, pp. 1036-1049, 2019.
A. P. B. M. J.L. Anco, «Kaggle,» Diciembre 2025. [En línea]. Available: https://www.kaggle.com/datasets/abadpomamaquera/meteorological-data-for-frost-prediction-in-peru.
A. P. B. M. J.L. Anco, «GitHub,» Diciembre 2025. [En línea]. Available: https://github.com/Abad-cyber/riesgo-heladas-xgboost-peru.git.
J. Pérez Tárraga , M. Castillo-Cara , E. Arias-Antúnez y D. Dujovne , «Frost forecasting through machine learning algorithms,» Earth Science Informatics, vol. 18, nº 183, pp. 1-16, 2025.
G. Ovando , M. Bocco y S. Sayago , «Redes neuronales para modelar predicción de heladas,» Agricultura Técnica (Chile), p. 65, 2005.
T. Chen y C. Guestrin , «XGBoost: A scalable tree boosting system,» Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 785-794, 2016.
R. Castillo Méndez y J. A. Camacho Castro , «Predicción de heladas y variables meteorológicas relevantes en agricultura en la Sabana de Bogotá usando machine learning,» Ingeniería y Desarrollo, vol. 43, nº 1, pp. 124-139, 2025.
C. J. Talsma , K. C. Solander , M. K. Mudunuru , B. Crawford y M. R. Powell , «Frost prediction using machine learning and deep neural network models,» Frontiers in Artificial Intelligence, vol. 5, nº 963781, pp. 1-16, 2023.
K.-Q. Li y H.-L. He, «Towards an improved prediction of soil-freezing characteristic curve based on extreme gradient boosting model,» Geoscience Frontiers, vol. 15, 2024.
D. Gómez , G. Araujo , F. E. Martínez , A. O. Rodríguez , J. M. Estupiñán y L. Y. Deantonio , «Early prediction of frost events in high altitude crops, using machine learning methods,» Revista Ceres, vol. 71, nº 4, pp. 1-22, 2024.
H. Li , J. Gao , . Y. Guo y X. G. Yuan , «Application of XGBoost model and multi-source data for winter wheat yield prediction in Henan Province of China,» Big Data and Information Analytics, vol. 9, pp. 29-47, 2025.
G. R. Huancavelica, «gob.pe,» 27 septiembre 2022. [En línea]. Available: https://www.gob.pe/institucion/regionhuancavelica/noticias/654544-mas-de-7-mil-agricultores-afectados-por-las-heladas-son-beneficiados-con-el-seguro-agrario.
D. F. O. Carráscal, «Helada intertropical, sus impactos y mitigación.,» Revista Ingenio, pp. 45-60.
K. S. M. M. B. C. M. P. Carl Talsma, «Predicción de heladas mediante aprendizaje automático y modelos de redes neuronales profundas,» Frontiers, 11 Enero 2023.