[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-128312-en":3,"doc-seo-128312-105":30,"detail-sidebar-cat-0-en-105":92},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},128312,962085564381,"Clementine","https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8",8,"Research & Report","Predicting food prices in Kenya using machine learning - a hybrid model approach with XGBoost and gradient boosting","Food price volatility remains a major challenge for Kenya’s economic stability, affecting households’ ability to purchase affordable and nutritious food while contributing to malnutrition and broader food and nutrition insecurity. This study uses a hybrid machine-learning framework that combines XGBoost with gradient boosting to predict Kenyan food prices. Data from the World Food Programme (Jan 2006–Sep 2024) and supporting macroeconomic variables are preprocessed, stacked into a hybrid ensemble, tuned, and evaluated to outperform standalone models. Results support deployment of a decision-support tool.","TYPE Original Research PUBLISHED 24 October 2025 DOI 10. 3389/frai.2025.1661989  \nOPEN ACCESS  \nEDITED BY  \nIdowu Oladele,  \nGlobal Center on Adaptation, Netherlands  \nREVIEWED BY  \nHasnain Iftikhar,  \nQuaid-i-Azam University, Pakistan Burak Öztornaci,  \nUniversity of Çukurova, Türkiye  \n*CORRESPONDENCE  \nKennedy Senagi  \n [ksenagi@strathmore.edu](ksenagi@strathmore.edu)  \nRECEIVED 09 July 2025  \nACCEPTED 30 September 2025  \nPUBLISHED 24 October 2025  \nCITATION  \nOgol BO, Omondi E, Olukuru J, Muriithi B and Senagi K (2025) Predicting food prices in Kenya using machine learning: a hybrid model approach with XGBoost and gradient boosting. Front. Artif. Intell. 8:1661989 .  \ndoi: 10.3389/frai.2025.1661989  \nCOPYRIGHT  \n© 2025 Ogol, Omondi, Olukuru, Muriithi and Senagi. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY) . The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.  \nPredicting food prices in Kenya using machine learning: a hybrid model approach with XGBoost and gradient boosting  \nBenard O. Ogol1 , Evans Omondi2,3 , John Olukuru1 , Betsy Muriithi1 and Kennedy Senagi1,4*  \n1 @ilabAfrica, Strathmore University, Nairobi, Kenya, 2 Institute of Mathematical Sciences, Strathmore University, Nairobi, Kenya, 3African Population and Health Research Center, Nairobi, Kenya,  \n4 International Centre of Insect Physiology and Ecology, Nairobi, Kenya  \nIntroduction: Food price volatility continues to be a signiﬁcant concern in Kenya’s economic development, posing challenges to the country’s economic stability.  \nMethodology: 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 inﬂation 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 overﬁtting and to perform model superiority analysis. Feature importance analysis using SHapley Additive exPlanations (SHAP) revealed that intuitive features inﬂuencing 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 ﬁles 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.  \nKEYWORDS  \nagricultural stakeholders, food insecurity, machine learning, malnutrition, policymakers, volatility  \n1 Introduction  \nFood is a fundamental necessity for human survival, signiﬁcantly impa","cbCaif28GqDtAOd6","https://ap.wps.com/l/cbCaif28GqDtAOd6","pdf",3433926,1,21,"English","en",105,"# Introduction\n## Food price volatility and food security context\n# Methodology\n## Data sources and preprocessing\n## Hybrid stacking model design\n## Model training and hyperparameter tuning\n# Results\n## Predictive performance metrics\n## Cross-validation and Diebold-Mariano tests\n## Feature importance with SHAP\n# Discussion\n## Policy and stakeholder applications","[{\"question\":\"What hybrid machine-learning approach is used to predict food prices in Kenya?\",\"answer\":\"The study stacks XGBoost and gradient boosting as base models, using linear regression as the meta-model to combine predictions.\"},{\"question\":\"Which data sources cover the prediction period?\",\"answer\":\"Food prices come from the World Food Programme from January 2006 to September 2024, and currency exchange rates and inflation rates are sourced from Kenya’s central bank data.\"},{\"question\":\"How does the hybrid model perform compared with standalone models?\",\"answer\":\"After tuning with random search and evaluation, the hybrid model achieves low error and a very high R-squared (0.9940), outperforming all standalone models.\"}]","Predicting food prices in Kenya using machine learning - a hybrid model approach with XGBoost and gradient boosting | PDF",1785946785,53,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":87,"head_meta":89,"extra_data":91,"updated_unix":28},"predicting-food-prices-in-kenya-using-machine-learning-a-hybrid-model-approach-with-xgboost-and-gradient-boosting","",{"@graph":36,"@context":86},[37,54,69],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":53},"https://docshare.wps.com/document/predicting-food-prices-in-kenya-using-machine-learning-a-hybrid-model-approach-with-xgboost-and-gradient-boosting/128312/",4,{"url":52,"name":13,"@type":55,"author":56,"headline":13,"publisher":58,"fileFormat":61,"inLanguage":23,"description":14,"dateModified":62,"datePublished":63,"encodingFormat":61,"isAccessibleForFree":64,"interactionStatistic":65},"DigitalDocument",{"name":9,"@type":57},"Person",{"url":41,"name":59,"@type":60},"DocShare","Organization","application/pdf","2026-08-23","2026-08-05",true,{"@type":66,"interactionType":67,"userInteractionCount":20},"InteractionCounter",{"@type":68},"ViewAction",{"@type":70,"mainEntity":71},"FAQPage",[72,78,82],{"name":73,"@type":74,"acceptedAnswer":75},"What hybrid machine-learning approach is used to predict food prices in Kenya?","Question",{"text":76,"@type":77},"The study stacks XGBoost and gradient boosting as base models, using linear regression as the meta-model to combine predictions.","Answer",{"name":79,"@type":74,"acceptedAnswer":80},"Which data sources cover the prediction period?",{"text":81,"@type":77},"Food prices come from the World Food Programme from January 2006 to September 2024, and currency exchange rates and inflation rates are sourced from Kenya’s central bank data.",{"name":83,"@type":74,"acceptedAnswer":84},"How does the hybrid model perform compared with standalone models?",{"text":85,"@type":77},"After tuning with random search and evaluation, the hybrid model achieves low error and a very high R-squared (0.9940), outperforming all standalone models.","https://schema.org",{"og:url":52,"og:type":88,"og:title":13,"og:site_name":59,"og:description":14},"article",{"robots":90,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":93},[94,98,102,106,111,116,121,124,129,132,136],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":95,"show_sort_weight":96,"slug":97},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":99,"show_sort_weight":100,"slug":101},"Literature",80,"literature",{"id":53,"doc_module":4,"doc_module_name":46,"category_name":103,"show_sort_weight":104,"slug":105},"Exam",70,"exam",{"id":107,"doc_module":4,"doc_module_name":46,"category_name":108,"show_sort_weight":109,"slug":110},5,"Comic",60,"comic",{"id":112,"doc_module":4,"doc_module_name":46,"category_name":113,"show_sort_weight":114,"slug":115},6,"Technology",50,"technology",{"id":117,"doc_module":4,"doc_module_name":46,"category_name":118,"show_sort_weight":119,"slug":120},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":122,"slug":123},30,"research-report",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":126,"show_sort_weight":127,"slug":128},9,"Religion & Spirituality",20,"religion-spirituality",{"id":127,"doc_module":4,"doc_module_name":46,"category_name":130,"show_sort_weight":127,"slug":131},"World Cup","world-cup",{"id":133,"doc_module":4,"doc_module_name":46,"category_name":134,"show_sort_weight":133,"slug":135},10,"Lifestyle","lifestyle",{"id":137,"doc_module":4,"doc_module_name":46,"category_name":138,"show_sort_weight":107,"slug":139},19,"General","general"]