Machine Learning project to predict Used cars in Egypt
# Used Cars Price Prediction (Egypt)
**Predicting used car prices using machine learning**
---
## Project summary
This repository contains a complete machine-learning pipeline to predict used-car prices (targeted for the Egyptian market). The project includes data cleaning and exploration, feature engineering, model training & evaluation, and a small inference script to get predictions from a saved model.
The goal is to produce a reliable regression model that estimates a fair price for a used car given its attributes (make, model, year, mileage, engine/horsepower, transmission, location, etc.), plus provide reproducible code and instructions.
---
## What I used
- **Language & environment:** Python 3.8+
- **Main libraries:** pandas, numpy, scikit-learn, xgboost, joblib, matplotlib, seaborn, jupyter
- **Development tools:** Jupyter Notebooks for EDA and experiments; `src/` scripts for reusable code; `req.txt` for dependencies
- **Optional frontend:** simple demo app (Flask or lightweight UI) — located in `frontend/` if present
---
## What I did (high level)
1. **Data collection & loading**
- Collected used-car listings dataset(s) (CSV files) with fields such as `make`, `model`, `year`, `mileage`, `engine_capacity`, `fuel_type`, `transmission`, `location`, `price`, `currency`, etc.
- Stored raw files under `data/raw/`.
2. **Exploratory Data Analysis (EDA)**
- Studied distributions, outliers, and missing-data patterns.
- Visualised relationships between features and price (year vs price, mileage vs price, brand effects).
3. **Data cleaning**
- Normalised text fields (lowercasing, trimming).
- Converted currencies / unified price units if needed.
- Handled missing values: domain-informed imputation for numeric fields, `unknown` for categorical where appropriate.
- Removed obvious outliers and duplicates.
4. **Feature engineering**
- Extracted age of car: `age = current_year - year`.
- Created mileage-per-year and bin categorical variables for price brackets.
- …