# eddaoudi-mohamed/predict_price_car architecture

> Architecture diagram of the GitHub repository eddaoudi-mohamed/predict_price_car, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eddaoudi-mohamed/predict_price_car
- Repository: https://github.com/eddaoudi-mohamed/predict_price_car

## Overview

##### Project type and purpose
- This is an end-to-end machine-learning pipeline to predict car prices. It includes data acquisition (scraping), data cleaning, exploratory analysis, preprocessing, model training & evaluation, and a deployment layer (API or web app).

##### File structure
- Top-level artifacts:
- Data.tar.zip & Models.tar.zip (archived raw/processed data and trained models)
- config/ (YAML files for split & training parameters)
- makefile (orchestration: archive, extract, clean)
- notebooks/ (Jupyter notebooks for each step in the ML workflow)
- Documentation/ (reports, graphs, tasks)
- requirements.txt
- Absence of src/ or app/ directories in the tree; they are implied in README.
- The pipeline is scripted via notebooks and governed by config files and Makefile targets.

##### Key README insights
- Seven sequential stages: Scraping → Cleaning → EDA → Preprocessing → Training → Evaluation → Deploying
- Dependencies: pandas, numpy, scikit-learn, matplotlib, seaborn, Flask/Django
- Makefile targets automate data/model archive and extraction.

a. Main components
1. External Data Source (Websites)
2. Scraper Module (notebooks/ScrapData.ipynb or src/scraper.py)
3. Raw Data Store (folder extracted from Data.tar.zip)
4. Cleaning Module (notebooks/CleaningData.ipynb)
5. EDA Module (notebooks/EDA.ipynb)
6. Preprocessing Module (notebooks/Preprocessing.ipynb + config/split_config.yaml)
7. Training Module (notebooks/ModelTraining.ipynb + config/training_config.yaml)
8. Model Registry (Models folder, archived in Models.tar.zip)
9. Evaluation Module (notebooks/Evaluation.ipynb)
10. Deployment Layer (app/, Flask/Django API or web UI)
11. Orchestration & Configuration (Makefile, requirements.txt)

b. Relationships & data flow
- Raw Data Store → Cleaning → Cleaned Data Store
- Cleaned Data Store → EDA (for insights, reports in Documentation/Graphs)
- Cleaned Data → Preprocessing → Train/Test Splits (governed by split_config.yaml)
- Splits → Training → Candidate Models → Model Registry
- Candidate Models + Test Splits → Evaluation → Metrics
- Selected Model → Deployment Layer → API Endpoint
- Orchestration (Makefile) interacts with Data Store & Model Registry

c. Architectural patterns & principles
- Pipeline pattern: sequential modules transforming data
- Configuration-as-code: all parameters in YAML
- Versioned artifacts: data & models zipped for reproducibility
- Modular notebooks for each stage (can be refactored to Python modules for production)

d. Technologies & frameworks
- Python, Jupyter Notebooks
- pandas, numpy, scikit-learn
- matplotlib, seaborn (visualization)
- Flask or Django for API deployment
- Makefile for orchestration
- YAML for configuration

## Diagram (Mermaid)

```mermaid
graph TD
    %% External Source
    ExternalData["External Data Source\n(Websites)"]:::external

    %% Data Store - Raw
    RawDataStore["Raw Data Store\n(Data.tar.zip)"]:::data

    %% Processing Modules
    Scraper["Scraper Module\n(notebooks/ScrapData.ipynb)"]:::process
    Cleaning["Cleaning Module\n(notebooks/CleaningData.ipynb)"]:::process
    EDA["EDA Module\n(notebooks/EDA.ipynb)"]:::process
    Preprocessing["Preprocessing Module\n(notebooks/Preprocessing.ipynb\nconfig/split_config.yaml)"]:::process
    Training["Training Module\n(notebooks/ModelTraining.ipynb\nconfig/training_config.yaml)"]:::process
    Evaluation["Evaluation Module\n(notebooks/Evaluation.ipynb)"]:::process

    %% Data Store - Cleaned
    CleanedDataStore["Cleaned Data Store"]:::data

    %% Train/Test Splits
    Splits["Train/Test Splits"]:::data

    %% Model Registry
    ModelRegistry["Model Registry\n(Models.tar.zip)"]:::data

    %% Deployment
    Deployment["Deployment Layer\n(Flask/Django API)"]:::deploy

    %% Orchestration & Config
    Orchestration["Orchestration & Configuration\n(makefile, requirements.txt)"]:::config

    %% Connections
    ExternalData -->|scrape| Scraper -->|output raw data| RawDataStore
    RawDataStore -->|clean| Cleaning -->|output cleaned data| CleanedDataStore
    CleanedDataStore -->|analyse| EDA
    CleanedDataStore -->|preprocess| Preprocessing -->|produce splits| Splits
    Splits -->|train| Training -->|save models| ModelRegistry
    Splits -->|evaluate| Evaluation -->|metrics| ModelRegistry
    ModelRegistry -->|deploy| Deployment
    Orchestration -->|controls| RawDataStore
    Orchestration -->|controls| ModelRegistry

    %% Click Events
    click Scraper "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/notebooks/ScrapData.ipynb"
    click Cleaning "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/notebooks/CleaningData.ipynb"
    click EDA "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/notebooks/EDA.ipynb"
    click Preprocessing "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/notebooks/Preprocessing.ipynb"
    click Preprocessing "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/config/split_config.yaml"
    click Training "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/notebooks/ModelTraining.ipynb"
    click Training "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/config/training_config.yaml"
    click Evaluation "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/notebooks/Evaluation.ipynb"
    click RawDataStore "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/Data.tar.zip"
    click ModelRegistry "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/Models.tar.zip"
    click Orchestration "https://github.com/eddaoudi-mohamed/predict_price_car/tree/master/makefile"
    click Orchestration "https://github.com/eddaoudi-mohamed/predict_price_car/blob/master/requirements.txt"

    %% Styles
    classDef data fill:#AEDFF7,stroke:#0366d6,color:#000;
    classDef process fill:#C8E6C9,stroke:#2E7D32,color:#000;
    classDef config fill:#FFE0B2,stroke:#FB8C00,color:#000;
    classDef deploy fill:#E1BEE7,stroke:#8E24AA,color:#000;
    classDef external fill:#F5F5F5,stroke:#9E9E9E,color:#000;
```
