Uganda Crop Yield Prediction - ML project for predicting maize yield using climate and soil data
# Uganda Crop Yield Prediction
A machine learning project that predicts maize yield in Uganda using agricultural and climate data.
## 📋 Project Overview
This project demonstrates an end-to-end machine learning workflow to predict crop yield based on climate and soil conditions. The goal is to help farmers and policymakers in Uganda make data-driven decisions to improve agricultural productivity and food security.
## 🎯 Problem Statement
Agriculture is the backbone of Uganda's economy, but several challenges exist:
- **Climate Unpredictability**: Weather patterns are becoming increasingly unpredictable
- **Farmer Decision-Making**: Farmers lack data-driven insights for better planning
- **Food Security**: Population growth requires improved crop productivity
- **Resource Optimization**: Limited resources need to be allocated efficiently
**Solution**: Use machine learning to predict crop yield based on historical patterns and environmental factors.
## 📊 Dataset
### Source
- Kaggle: Search "crop yield prediction", "maize yield Uganda"
- FAO (Food and Agriculture Organization): agro-climatic and yield statistics
### Features Used
| Feature | Type | Description |
|---------|------|-------------|
| Rainfall_mm | Numerical | Annual/seasonal rainfall in millimeters |
| Temperature_C | Numerical | Average temperature in Celsius |
| Soil_Type | Categorical | Type of soil (Sandy, Loam, Clay) |
| Season | Categorical | Growing season (Wet, Dry) |
| Year | Numerical | Year of observation |
| District | Categorical | Region in Uganda |
| Fertilizer_kg_ha | Numerical | Fertilizer application rate |
| **Yield_tons_ha** | **Numerical** | **Crop yield (TARGET VARIABLE)** |
### Dataset Statistics
- **Size**: 200+ records
- **Time Period**: 2015-2025
- **Regions**: Multiple districts across Uganda
- **Classes**: Balanced across different soil types and seasons
## 🔧 Methodology
### 1. Exploratory Data Analysis (EDA)
- Analyzed distributions of numerical features
- Identified …