ML-powered crop yield prediction for Tanzania (maize, rice, cassava) - food security analysis and agricultural lending risk assessment using 35 years of FAO data.
# 🌾 Food Security & Agricultural Lending Risk | Machine Learning Crop Yield Forecasting | Tanzania Agritech
> **Can machine learning predict crop yields well enough to replace gut-feel agricultural lending decisions in Tanzania?**
> This project proves it can - and quantifies exactly how much money wrong model selection costs.
---
## 📊 Impact at a Glance
| Metric | Result |
|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Best model R² (Rice) | **0.979** - explains 97.9% of yield variation |
| Maize prediction improvement | **R² 0.003 → 0.632** after adding climate variables (+629%) |
| Regional yield disparity identified | **Songwe yields 6.5x more maize than Lindi** |
| Wrong model cost (cassava) | Linear Regression predicts **3,912 kg/ha** by 2030 vs Random Forest's **6,423 kg/ha** - a 64% underestimation that directly misallocates agricultural credit |
| Farm records analysed | **26,000+** NBS Tanzania microdata records across 31 regions |
| Years of data | **35 years** (1990–2024) |
---
## 🗂️ Executive Summary
**Business Problem:** Tanzanian banks and agricultural lenders assess smallholder loan applications using field visits and subjective judgment - e …