β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 β¦