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