Predict house prices in Egypt using web-scraped property data. This project includes data collection from Bayut, cleaning, exploratory analysis, feature engineering, and XGBoost-based price prediction.
# House Price Prediction in Egypt
**House Price Prediction in Egypt** is a data-driven project that combines **web scraping**, **data analysis**, and **machine learning** to estimate real estate prices across different regions of Egypt. The project demonstrates the end-to-end workflow from data collection to predictive modeling.
---
## Table of Contents
* Project Overview
* Data Acquisition
* Data Preprocessing
* Exploratory Data Analysis
* Feature Engineering
* Model Development
* Model Evaluation
* Usage
* Dependencies
* License
---
## Project Overview
The primary objective of this project is to **predict property prices** in Egypt using features such as:
* Area in square meters
* Number of bedrooms and bathrooms
* Unit type (apartment, villa, etc.)
* Geographic information (region and locality)
The workflow includes:
1. Scraping property listings from Bayut Egypt.
2. Cleaning and preprocessing the collected data.
3. Conducting exploratory data analysis (EDA) to understand key trends.
4. Feature engineering to enhance model performance.
5. Training an XGBoost regression model to predict house prices.
---
## Data Acquisition
The dataset is collected through **web scraping** using Python libraries:
* `requests` for HTTP requests
* `BeautifulSoup` for HTML parsing
Key steps:
1. Extract structured JSON-LD data from each property listing.
2. Capture attributes such as:
* Name
* Latitude & Longitude
* Area (Sq. M.)
* Bedrooms & Bathrooms
* Region & Locality
* Unit type
* Price (EGP)
The scraped data is saved as `units_details.csv`.
---
## Data Preprocessing
* Removal of missing or incomplete records.
* Type conversions for numeric fields (e.g., `bedrooms`, `bathrooms`, `price`).
* Rounding and normalization where necessary.
* Handling categorical variables via **one-hot encoding** for region, locality, and unit type.
* Creation of derived features:
* `room_bath_ratio` = bedrooms / (bathrooms + ε)
* `price_per_sqm` = price / area
---
## Explorator …