# mahlatsim/vehiclepricepredictor architecture

> Architecture diagram of the GitHub repository mahlatsim/vehiclepricepredictor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahlatsim/vehiclepricepredictor
- Repository: https://github.com/mahlatsim/vehiclepricepredictor

## Overview

This is a Streamlit used-car price predictor and market-insights app. Users navigate from a landing page to either an interactive dashboard or a prediction form; prediction builds vehicle features, scales them, runs an XGBoost model, and displays an estimate with a confidence interval. The dashboard reads the car dataset and presents market, brand, and feature analyses. Prediction and dashboard excerpts show their local data and model operations; connections between pages and documented capabilities rely on the README, and unsampled implementation details are not inferred.

Main entry points: [`pages/Prediction.py`](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py) (Prediction page), [`pages/Dashboard.py`](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Dashboard.py) (Dashboard page), [`cardekho_dataset.csv`](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/cardekho_dataset.csv) (Car listings), [`scaler.pkl`](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/scaler.pkl) (Feature scaler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Streamlit App"]
  node_home["Landing page<br/>[Home.py]"]
end

subgraph group_prediction["Price Prediction"]
  node_prediction_page["Prediction page<br/>[Prediction.py]"]
  node_vehicle_inputs["Vehicle inputs<br/>[Prediction.py]"]
  node_feature_prep["Feature preparation<br/>[Prediction.py]"]
  node_scaler["Feature scaler<br/>[scaler.pkl]"]
  node_model["XGBoost model<br/>[Best_model.xgb]"]
  node_prediction_logic["Price inference<br/>[Prediction.py]"]
  node_interval["Confidence interval<br/>[Prediction.py]"]
  node_prediction_result["Price result<br/>[Prediction.py]"]
  node_train_features["Training features<br/>[X_train_scaled.npy]"]
  node_train_labels["Training labels<br/>[Y_train.npy]"]
end

subgraph group_insights["Market Insights"]
  node_dashboard["Dashboard page<br/>[Dashboard.py]"]
  node_car_data["Car listings"]
  node_market_overview["Market overview<br/>[Dashboard.py]"]
  node_brand_analysis["Brand comparisons<br/>[Dashboard.py]"]
  node_feature_analysis["Feature analysis<br/>[Dashboard.py]"]
end

node_visitor(("App user"))

node_visitor -->|"opens"| node_home
node_visitor -->|"navigates to"| node_dashboard
node_visitor -->|"navigates to"| node_prediction_page
node_prediction_page -->|"collects"| node_vehicle_inputs
node_vehicle_inputs -->|"encodes"| node_feature_prep
node_prediction_page -->|"loads"| node_scaler
node_prediction_page -->|"loads"| node_model
node_prediction_page -->|"loads"| node_train_features
node_prediction_page -->|"loads"| node_train_labels
node_feature_prep -->|"transforms with"| node_scaler
node_prediction_page -->|"invokes"| node_prediction_logic
node_prediction_logic -->|"predicts with"| node_model
node_prediction_logic -->|"calculates bounds"| node_interval
node_interval -->|"displays"| node_prediction_result
node_dashboard -->|"reads"| node_car_data
node_dashboard -->|"presents"| node_market_overview
node_dashboard -->|"presents"| node_brand_analysis
node_dashboard -->|"presents"| node_feature_analysis
node_car_data -->|"informs"| node_market_overview
node_car_data -->|"informs"| node_brand_analysis
node_car_data -->|"informs"| node_feature_analysis

click node_home "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/Home.py"
click node_prediction_page "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py"
click node_vehicle_inputs "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py"
click node_feature_prep "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py"
click node_scaler "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/scaler.pkl"
click node_model "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/Best_model.xgb"
click node_prediction_logic "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py"
click node_interval "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py"
click node_prediction_result "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py"
click node_train_features "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/X_train_scaled.npy"
click node_train_labels "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/Y_train.npy"
click node_dashboard "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Dashboard.py"
click node_car_data "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/cardekho_dataset.csv"
click node_market_overview "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Dashboard.py"
click node_brand_analysis "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Dashboard.py"
click node_feature_analysis "https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Dashboard.py"

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_home,node_visitor toneBlue
class node_prediction_page,node_vehicle_inputs,node_feature_prep,node_scaler,node_model,node_prediction_logic,node_interval,node_prediction_result,node_train_features,node_train_labels toneAmber
class node_dashboard,node_car_data,node_market_overview,node_brand_analysis,node_feature_analysis toneMint
```

## Components

### Streamlit App

- [Landing page](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/Home.py): `Home.py`

### Price Prediction

- [Prediction page](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py): `pages/Prediction.py`
- [Vehicle inputs](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py): `pages/Prediction.py`
- [Feature preparation](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py): `pages/Prediction.py`
- [Feature scaler](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/scaler.pkl): `scaler.pkl`
- [XGBoost model](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/Best_model.xgb): `Best_model.xgb`
- [Price inference](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py): `pages/Prediction.py`
- [Confidence interval](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py): `pages/Prediction.py`
- [Price result](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Prediction.py): `pages/Prediction.py`
- [Training features](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/X_train_scaled.npy): `X_train_scaled.npy`
- [Training labels](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/Y_train.npy): `Y_train.npy`

### Market Insights

- [Dashboard page](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Dashboard.py): `pages/Dashboard.py`
- [Car listings](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/cardekho_dataset.csv): `cardekho_dataset.csv`
- [Market overview](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Dashboard.py): `pages/Dashboard.py`
- [Brand comparisons](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Dashboard.py): `pages/Dashboard.py`
- [Feature analysis](https://github.com/mahlatsim/vehiclepricepredictor/blob/main/pages/Dashboard.py): `pages/Dashboard.py`

### Other components

- **App user**

## Connections

- App user → Landing page: opens (evidence: `readme.md`)
- App user → Dashboard page: navigates to (evidence: `readme.md`)
- App user → Prediction page: navigates to (evidence: `readme.md`)
- Prediction page → Vehicle inputs: collects (evidence: `pages/Prediction.py`)
- Vehicle inputs → Feature preparation: encodes (evidence: `pages/Prediction.py`)
- Prediction page → Feature scaler: loads (evidence: `pages/Prediction.py`)
- Prediction page → XGBoost model: loads (evidence: `pages/Prediction.py`)
- Prediction page → Training features: loads (evidence: `pages/Prediction.py`)
- Prediction page → Training labels: loads (evidence: `pages/Prediction.py`)
- Feature preparation → Feature scaler: transforms with (evidence: `pages/Prediction.py`)
- Prediction page → Price inference: invokes (evidence: `pages/Prediction.py`)
- Price inference → XGBoost model: predicts with (evidence: `pages/Prediction.py`)
- Price inference → Confidence interval: calculates bounds (evidence: `pages/Prediction.py`)
- Confidence interval → Price result: displays (evidence: `pages/Prediction.py`)
- Dashboard page → Car listings: reads (evidence: `pages/Dashboard.py`)
- Dashboard page → Market overview: presents (evidence: `readme.md`)
- Dashboard page → Brand comparisons: presents (evidence: `readme.md`)
- Dashboard page → Feature analysis: presents (evidence: `readme.md`)
- Car listings → Market overview: informs (evidence: `pages/Dashboard.py`)
- Car listings → Brand comparisons: informs (evidence: `pages/Dashboard.py`)
- Car listings → Feature analysis: informs (evidence: `pages/Dashboard.py`)
