End-to-end DS project — scraping, cleaning, EDA, ML model and Streamlit dashboard
# 🏠 Kenya Property Price Predictor
> End-to-end Data Science project — real data scraped from BuyRentKenya.com, cleaned, analysed and deployed as a live web app.
🔗 **Live App:** kenya-property-price-predictor.streamlit.app
---
## 📸 Screenshots
---
## 🎯 Project Overview
Most Data Science portfolio projects use pre-cleaned Kaggle datasets. This project collects its own data from scratch.
I scraped **1,733 real Kenyan property listings** from BuyRentKenya.com, cleaned the messy raw data, ran exploratory data analysis, trained a Random Forest model to predict property prices, and deployed everything as a live interactive web app.
**Business Question:** *Given a property's bedrooms, type and location — what should it cost in the Kenyan market?*
---
## 🔄 Project Pipeline
```
SCRAPE ──► CLEAN ──► EDA ──► MODEL ──► DEPLOY
```
---
## 📁 Project Structure
```
kenya-property-price-predictor/
│
├── app.py # Streamlit dashboard
├── buyrentkenya_scraper_v4.py # Web scraper
├── cleaning.ipynb # Data cleaning notebook
├── EDA_model.ipynb # EDA + ML model notebook
│
├── buyrentkenya_raw.csv # Raw scraped data (1,743 rows)
├── buyrentkenya_clean.csv # Cleaned dataset (1,733 rows)
│
├── requirements.txt # Python dependencies
├── app_pic1.png # App screenshot 1
├── app_pic2.png # App screenshot 2
└── README.md
```
---
## 🔍 Stage Breakdown
### 1️⃣ Web Scraping — `buyrentkenya_scraper_v4.py`
- Built with `requests` and `BeautifulSoup`
- Used Chrome DevTools to identify stable `data-cy` HTML attributes on the site
- Scraped both **For Sale** and **For Rent** listings across 40 pages each
- Fields collected: listing ID, title, price, bedrooms, bathrooms, size, location, property type
- Output: `buyrentkenya_raw.csv` — **1,743 rows**
### 2️⃣ Data Cleaning — `cleaning.ipynb`
- Parsed `"KSh 75,000,000"` → `75000000.0` (clean numeric)
- Extr …