Forecast weekly market prices for maize in Kenya
# Kenya Maize Price Forecasting — Pipeline
This competition is hosted on Zindi, a machine learning platform for data science challenges.
Here is the link to the competition: agriBORA Commodity Price Forecasting Challenge 🌾 - Win €8,250 EUR
Ranked in the TOP 24%
---
Zindi competition · agriBORA × KAMIS · Weekly price prediction for 5 Kenya counties.
---
## Competition Overview
| Item | Details |
|---|---|
| Task | Predict the weekly average wholesale maize price (KES) |
| Target counties | Kiambu, Kirinyaga, Mombasa, Nairobi, Uasin-Gishu |
| Horizon | 2 weeks ahead, rolling |
| Metric | `score = 0.5 × MAE + 0.5 × RMSE` (lower is better) |
| Submission format | One row per `{County}_Week_{iso_week}` |
| Both target columns | `Target_RMSE` and `Target_MAE` hold the same predicted price |
| Seed | `1618` |
---
## Data Sources
| File | Description |
|---|---|
| `kamis_maize_prices.csv` | KAMIS daily market prices — filtered to `Classification == "White_Maize"` |
| `agribora_maize_prices.csv` | agriBORA weekly transaction prices (main series) |
| `agriBORA_maize_prices_weeks_46_to_51.csv` | Extended agriBORA weeks 46–51 |
| `agriBORA_Final_Weeks_maize_price.csv` | Final scoring truth (optional) |
| `SampleSubmission.csv` | Submission format reference |
All data files must be placed in `DATA_DIR` (default: `C:/Users/mtrigui2/Desktop/Z1`).
---
## Pipeline Structure
```
pipeline_maize/
├── 00_config.r Libraries, paths, constants, helper functions
├── 01_data_loading.r Load KAMIS + agriBORA raw data
├── 02_data_cleaning.r Snap to Monday, impute, calibrate, LOCF fill
├── 03_feature_engineering.r Lags, rolling stats, seasonality, momentum
├── 04_build_train_test.r Multicollinearity removal, chronological split
├── 05_models.r LightGBM, XGBoost, ARIMA, ETS, Prophet, Ensemble
├── 06_evaluation.r Walk-forward CV, holdout leaderboard, feature importance
├── 07_submission.r Rolling 2-wee …