Logo Lanfrica

symo101/kenya-property-price-predictor

Domain:

socioeconomic

Record type:

project
Creator:
sym
Host:
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 …