# med-rhaled/car-price-prediction architecture

> Architecture diagram of the GitHub repository med-rhaled/car-price-prediction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/med-rhaled/car-price-prediction
- Repository: https://github.com/med-rhaled/car-price-prediction

## Overview

This repository is a notebook-based used-car price prediction project. Its documented workflow takes vehicle data through exploratory analysis and cleaning, prepares and encodes features, then trains and evaluates a tuned Random Forest model. The README also describes feature-importance analysis. Notebook internals were not sampled, so the graph reflects documented stages and relationships rather than verified code-level calls.

Main entry points: [`notebooks/03_modeling.ipynb`](https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb) (Random Forest training), [`notebooks/01_eda.ipynb`](https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/01_eda.ipynb) (Exploratory analysis), [`notebooks/02_preprocessing.ipynb`](https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/02_preprocessing.ipynb) (Data preprocessing), [`data/car_price_prediction_cleaned.csv`](https://github.com/med-rhaled/car-price-prediction/blob/main/data/car_price_prediction_cleaned.csv) (Cleaned vehicle data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Vehicle data"]
  node_raw["Raw vehicle data"]
  node_clean["Cleaned vehicle data"]
end

subgraph group_prep["Analysis and preparation"]
  node_eda["Exploratory analysis<br/>[01_eda.ipynb]"]
  node_preprocess["Data preprocessing"]
end

subgraph group_model["Modeling and evaluation"]
  node_encoding["Feature encoding<br/>[03_modeling.ipynb]"]
  node_training["Random Forest training<br/>[03_modeling.ipynb]"]
  node_tuning["Hyperparameter search<br/>[03_modeling.ipynb]"]
  node_evaluation["Model evaluation<br/>[03_modeling.ipynb]"]
  node_importance["Feature importance<br/>[03_modeling.ipynb]"]
end

node_user(("Analyst"))

node_user -->|"runs first"| node_eda
node_raw -->|"analyzes"| node_eda
node_user -->|"runs next"| node_preprocess
node_eda -->|"precedes"| node_preprocess
node_preprocess -->|"saves cleaned data"| node_clean
node_user -->|"runs modeling"| node_encoding
node_clean -->|"prepares features"| node_encoding
node_encoding -->|"encodes features"| node_training
node_training -->|"tunes model"| node_tuning
node_tuning -->|"evaluates model"| node_evaluation
node_training -->|"reports metrics"| node_evaluation
node_training -->|"examines importance"| node_importance

click node_raw "https://github.com/med-rhaled/car-price-prediction/blob/main/data/car_price_prediction.csv"
click node_eda "https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/01_eda.ipynb"
click node_preprocess "https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/02_preprocessing.ipynb"
click node_clean "https://github.com/med-rhaled/car-price-prediction/blob/main/data/car_price_prediction_cleaned.csv"
click node_encoding "https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb"
click node_training "https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb"
click node_tuning "https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb"
click node_evaluation "https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb"
click node_importance "https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_raw,node_clean toneBlue
class node_eda,node_preprocess toneAmber
class node_encoding,node_training,node_tuning,node_evaluation,node_importance toneMint
class node_user toneIndigo
```

## Components

### Vehicle data

- [Raw vehicle data](https://github.com/med-rhaled/car-price-prediction/blob/main/data/car_price_prediction.csv): `data/car_price_prediction.csv`
- [Cleaned vehicle data](https://github.com/med-rhaled/car-price-prediction/blob/main/data/car_price_prediction_cleaned.csv): `data/car_price_prediction_cleaned.csv`

### Analysis and preparation

- [Exploratory analysis](https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/01_eda.ipynb): `notebooks/01_eda.ipynb`
- [Data preprocessing](https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/02_preprocessing.ipynb): `notebooks/02_preprocessing.ipynb`

### Modeling and evaluation

- [Feature encoding](https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb): `notebooks/03_modeling.ipynb`
- [Random Forest training](https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb): `notebooks/03_modeling.ipynb`
- [Hyperparameter search](https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb): `notebooks/03_modeling.ipynb`
- [Model evaluation](https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb): `notebooks/03_modeling.ipynb`
- [Feature importance](https://github.com/med-rhaled/car-price-prediction/blob/main/notebooks/03_modeling.ipynb): `notebooks/03_modeling.ipynb`

### Other components

- **Analyst**

## Connections

- Analyst → Exploratory analysis: runs first (evidence: `README.md`)
- Raw vehicle data → Exploratory analysis: analyzes (evidence: `README.md`)
- Analyst → Data preprocessing: runs next (evidence: `README.md`)
- Exploratory analysis → Data preprocessing: precedes (evidence: `README.md`)
- Data preprocessing → Cleaned vehicle data: saves cleaned data (evidence: `README.md`)
- Analyst → Feature encoding: runs modeling (evidence: `README.md`)
- Cleaned vehicle data → Feature encoding: prepares features (evidence: `README.md`)
- Feature encoding → Random Forest training: encodes features (evidence: `README.md`)
- Random Forest training → Hyperparameter search: tunes model (evidence: `README.md`)
- Hyperparameter search → Model evaluation: evaluates model (evidence: `README.md`)
- Random Forest training → Model evaluation: reports metrics (evidence: `README.md`)
- Random Forest training → Feature importance: examines importance (evidence: `README.md`)
