This project presents a data analytics case study using a fictional real estate dataset from Kenya. It aims to extract insights and build predictive models that estimate property prices using machine learning.
# Real Estate Data Analytics in Kenya – Project Notes
This project presents a data analytics case study using a fictional real estate dataset from Kenya. It aims to extract insights and build predictive models that estimate property prices using machine learning.
---
## 1. Project Overview
This notebook simulates a dataset for Kenyan housing properties and applies analytics to:
- Understand housing market trends
- Identify key features affecting pricing
- Predict property prices using machine learning
---
## 2. Data Generation
A synthetic dataset was generated to resemble real-world Kenyan housing data, including:
- `Bedrooms`, `Bathrooms`, `Size_sqm`, `Proximity_CBD_km`
- `Location`: Nairobi, Mombasa, Kisumu, Eldoret
- `House_Type`: Apartment, Bungalow, Maisonette
- `Price_KES`: Simulated price values based on features
The data was generated with logical patterns, such as larger or better-located houses costing more.
---
## 3. Exploratory Data Analysis (EDA)
Key insights from the dataset:
- **Size and price** are positively correlated
- **Proximity to CBD** inversely affects price
- **Nairobi and Mombasa** tend to have higher average prices
- **House type** influences pricing (e.g., Maisonettes are more expensive)
Tools used include bar plots, scatter plots, boxplots, and correlation heatmaps.
---
## 4. Feature Engineering
Selected features:
- `Bedrooms`, `Bathrooms`, `Size_sqm`, `Proximity_CBD_km`
- Target: `Price_KES`
These features are both interpretable and relevant to home buyers and sellers in Kenya.
---
## 5. Machine Learning Models
### 🔹 Linear Regression
- Assumes a linear relationship between features and price
- Easy to interpret and a good baseline
- Metrics:
- **Mean Absolute Error (MAE)**
- **R² Score**
### 🔹 Random Forest Regressor
- Ensemble model combining multiple decision trees
- Captures non-linear relationship …