EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

Predicting food prices in Kenya using machine learning: a hybrid model approach with XGBoost and gradient boosting

Benard O Ogol, Evans Omondi, John Olukuru, Betsy Muriithi, Kennedy Senagi

Frontiers in Artificial Intelligence · 24.10.2025 · 8

DOI: 10.3389/frai.2025.1661989 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Frontiers in Artificial Intelligence, online erschienen am 24.10.2025. Verfasst von Benard O Ogol und 4 weiteren Autor:innen. Beteiligte Einrichtung: @ilabAfrica, Strathmore University, Nairobi, Kenya. Die Arbeit wurde bisher 9-mal zitiert (Crossref) und nennt 84 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0).

AbstractSchlagwörterBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Introduction

Food price volatility continues to be a significant concern in Kenya's economic development, posing challenges to the country's economic stability. Methodology This study examines the application of machine learning methods, employing a hybrid approach that combines XGBoost and gradient boosting, to predict food prices in Kenya. The food prices data from the World Food Programme, covering the period from January 2006 to September 2024, as well as currency exchange rates data from the Central Bank of Kenya in US dollars (USD) and inflation rates data, were collated and preprocessed to be ready for analytics and machine learning. The augmented data were preprocessed and transformed, then used to train XGBoost, gradient boosting, LightGBM, decision tree, random forest, and linear regression. A hybrid model was then developed by stacking XGBoost and gradient boosting as the base models, with linear regression serving as the meta-model used to combine their predictions.

Results

This model was then tuned using the hyperparameter random search method, achieving a mean absolute error of 0.1050, a mean squared error of 0.0261, a root mean square error of 0.1615, and an R-squared value of 0.9940, thereby surpassing the performance of all standalone models. We then applied cross-validation using 5-fold cross-validation and Diebold-Mariano tests to check for model overfitting and to perform model superiority analysis. Feature importance analysis using SHapley Additive exPlanations (SHAP) revealed that intuitive features influencing food prices are unit quantity, price type, commodity, and currency, while geographical factors such as county have a lesser impact. Finally, the model and its important features were saved as pickle files to facilitate the deployment of the model on a web application for food price predictions.

Discussion

This data-driven decision support system can help policymakers and agricultural stakeholders (such as the Kenyan government) plan for future trends in food prices, potentially helping to prevent food insecurity in Kenya.

Schlagwörter

Stichwörter der Autor:innen

agricultural stakeholdersfood insecuritymachine learningmalnutritionpolicymakersvolatility

Autor:innen und Institutionen

  • @ilabAfrica, Strathmore University, Nairobi, Kenya.
  • Institute of Mathematical Sciences, Strathmore University, Nairobi, Kenya.
  • African Population and Health Research Center, Nairobi, Kenya.
  • International Centre of Insect Physiology and Ecology, Nairobi, Kenya.

Zitieren

APA

Ogol, B. O., Omondi, E., Olukuru, J., Muriithi, B., & Senagi, K. (2025). Predicting food prices in Kenya using machine learning: a hybrid model approach with XGBoost and gradient boosting. Frontiers in Artificial Intelligence, 8. https://doi.org/10.3389/frai.2025.1661989

Vancouver

Ogol BO, Omondi E, Olukuru J, Muriithi B, Senagi K. Predicting food prices in Kenya using machine learning: a hybrid model approach with XGBoost and gradient boosting. Frontiers in Artificial Intelligence. 2025;8. doi:10.3389/frai.2025.1661989

BibTeX
@article{Ogol2025,
  author = {Ogol, Benard O and Omondi, Evans and Olukuru, John and Muriithi, Betsy and Senagi, Kennedy},
  title = {Predicting food prices in Kenya using machine learning: a hybrid model approach with XGBoost and gradient boosting},
  journal = {Frontiers in Artificial Intelligence},
  year = {2025},
  volume = {8},
  doi = {10.3389/frai.2025.1661989}
}
Kostenlos starten →