“Regression analysis on environmental factors affecting crop yield in Maji Ndogo
# 🌾 Predicting Crop Yields in Maji Ndogo: A Linear Regression Learning Journey
This repository contains the code, data, and visuals used in the **Maji Ndogo Crop Yield Analysis** project — a data science exploration of how environmental factors such as temperature and pollution influence agricultural productivity.
What began as an ALX classroom assignment evolved into a personal project to strengthen my data analysis and storytelling skills.
I refined the original notebook, explored the data more deeply, and transformed it into a portfolio piece that showcases both technical understanding and interpretation.
---
## 📊 Project Overview
**Goal:**
To determine whether temperature or pollution levels have a measurable linear relationship with standardized crop yield in Maji Ndogo.
**Key Findings:**
- 🌡️ **Average Temperature:** Showed almost no linear relationship with yield.
- 🏭 **Pollution Level:** Displayed a weak negative correlation — higher pollution slightly reduced yield.
- 📈 **Model Evaluation:** Low R² (~0.08) suggests pollution alone cannot explain yield variations.
- 🔍 **Residual Analysis:** Residuals were mostly random, but minor heteroscedasticity hints at missing variables.
📖 **Read the full article on Medium:**
👉 Predicting Crop Yields in Maji Ndogo: A Linear Regression Learning Journey
---
## 🧩 Repository Structure
Maji-Ndogo-Regression-Analysis/
│
├── data/
│ └── maji_ndogo.db # SQLite database
│
├── notebooks/
│ └── Maji_Ndogo_Regression_Analysis.ipynb
│
├── visuals/
│ ├── temperature_vs_yield.png
│ ├── pollution_vs_yield.png
│ ├── residual_histogram.png
│ └── residuals_vs_predicted.png
│
├── requirements.txt
└── README.md
---
## 🚀 How to Run
1. **Clone this repository**
```bash
git clone
github.com
cd Maji-Ndogo-Regression-Analysis
Install dependencies
pip install -r requirements.txt
Launch the notebook
jupyter notebook notebooks/Maji_Ndogo_Regression_Analysis.ipynb
(Optiona …