# 🌾 Kenya Crop Yield Forecaster
**A production-grade agricultural intelligence pipeline that fetches 24 years of World Bank open data across 5 East African countries and 6 agricultural indicators, trains 29 Facebook Prophet time-series models with 3-year holdout evaluation, and serves a fully interactive Streamlit dashboard with 5-year forecasts, confidence intervals, drought event annotations, and one-click Excel export — running entirely free at $0 cost.**
| Metric | Value |
|---|---|
| Dataset rows | 720 |
| Countries | Kenya, Uganda, Tanzania, Ethiopia, Nigeria |
| Indicators | 6 |
| Years covered | 2000–2023 |
| Forecast horizon | 5 years (2024–2028) |
| Prophet models trained | 29 |
| Models skipped (sparse data) | 1 (Ethiopia / Malnutrition — 6 obs) |
| Dashboard tabs | 4 |
| Lines of code (app.py) | 625 |
| Data source | World Bank REST API v2 |
| Infrastructure cost | $0 |
---
## 🎯 Project Goal
Kenya's agricultural sector faces compounding pressures from climate variability, land-use change, and food security challenges. National planners, agribusiness analysts, and development practitioners need forward-looking data on crop yields, food production, and land utilisation — but publicly available forecasting tools are either paywalled, too coarse for country-level analysis, or reliant on static datasets.
This project builds a fully automated pipeline that:
1. Pulls live annual data from the World Bank Open Data API for Kenya and four regional peer countries.
2. Trains individual Prophet time-series models per country and indicator combination, validated against a 3-year holdout.
3. Surfaces all results in a dark-theme Streamlit dashboard with adjustable forecast horizons, statistical confidence bands, and historical drought annotations.
4. Allows analysts to download a structured Excel workbook covering forecasts, raw historical values, and model performance metrics for offline reporting.
The project is benchmarked against Nigeria — Africa's largest a …