Machine learning models for predicting crop yield and rainfall trends in Kitui County, Kenya. Includes Random Forest, XGBoost, and ARIMA models with insights for climate-resilient agriculture.
# πΎ Climate-Smart Agriculture in Kitui County
**Data-driven crop yield prediction and rainfall forecasting using machine learning.**
## π Project Overview
This project applies predictive analytics to agriculture in Kitui County, Kenya β a region facing climate challenges like erratic rainfall and soil degradation.
We use machine learning models to:
- Predict annual crop yields based on environmental factors
- Forecast rainfall trends to anticipate drought risk
- Recommend smart, climate-resilient farming practices
## π§ Objectives
1. **Predict Crop Yield:** Using Random Forest and XGBoost to forecast yields based on rainfall, soil moisture, temperature, and fertilizer use.
2. **Forecast Rainfall:** Using ARIMA to model and project rainfall patterns up to 2035.
3. **Actionable Insights:** Recommending drought-tolerant crops, smart irrigation, and data-informed decisions.
## π Tools & Technologies
- Python
- Jupyter Notebook
- pandas, scikit-learn, xgboost, matplotlib, seaborn, statsmodels, pmdarima
- Machine Learning + Time-Series Forecasting
## π Files Included
- `Kitui_Crop_Yield_Simulation.csv`: Sample dataset with environmental & agricultural data
- `kitui_crop_yield_forecast.ipynb`: Jupyter notebook with code, models, and visualizations
- `README.md`: This documentation
## π Insights
- Top predictors of yield: rainfall, soil moisture, crop type
- Forecast suggests a 10β15% decline in rainfall by 2035
- Recommends drought-resilient crops like pigeon peas and sorghum, plus smart irrigation
## π¬ How to Use
Clone the repo and run the Jupyter Notebook:
```bash
git clone
github.com
cd kitui-crop-forecast
jupyter notebook