# 🌾 Ethiopian Food Price Prediction — ML Pipeline
> **WFP Market Price Data · 60,343 records · 96 Commodities · 128 Markets · 2000–2026**
> Masters Program — Machine Learning Final Project · 2026
---
## 📋 Project Overview
Food price volatility in Ethiopia directly impacts food security for millions of people. This project builds a full **machine learning pipeline** that predicts retail and wholesale food prices (ETB) across 128 Ethiopian markets and 96 commodity types, using 26 years of WFP market price data.
The project is deployed as a **Streamlit web application** where users can select a commodity, market, and forecast date to instantly predict the expected price.
### Results
| Metric | Value |
|---|---|
| Best Model | RandomForest (tuned) |
| Test R² | **0.872** — 87.2% of variance explained |
| Test RMSE | **1,245 ETB** average error |
| Test MAE | **668 ETB** median absolute error |
| Train R² | 0.966 (healthy gap — not severe overfitting) |
---
## 📁 Project Structure
```
food_price_prediction/
├── data/
│ └── wfp_food_prices_eth.csv ← WFP price data (place here)
├── models/ ← auto-created by train.py
│ ├── best_model.pkl ← fitted sklearn Pipeline
│ ├── encoders.pkl ← LabelEncoders for Streamlit dropdowns
│ ├── feature_names.json ← metadata, metrics, commodity lists
│ ├── training_report.txt ← human-readable performance summary
│ ├── eda_report.png ← 4-panel EDA chart
│ └── diagnostics.png ← residuals + feature importance chart
├── train.py ← full 8-step ML pipeline
├── app.py ← Streamlit deployment app
└── requirements.txt ← Python dependencies
```
---
## ⚙️ Quick Start
### 1. Install dependencies
```bash
pip install -r requirements.txt
```
### 2. Train the model (runs all 8 pipeline steps)
```bash
python train.py
```
Expected runtime: **5–15 minu …