# saad-7-2020/projet_mobile_prices architecture

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

- Interactive diagram: https://gitdiagram.com/saad-7-2020/projet_mobile_prices
- Repository: https://github.com/saad-7-2020/projet_mobile_prices

## Overview

This repository trains a phone price-range classifier and serves predictions through a Streamlit form. The training workflow reads the CSV, scales features, fits logistic regression, and saves the scaler and model; the app loads those artifacts, transforms submitted phone attributes, predicts a class, and displays it. The graph reflects the two provided scripts and their explicit file interactions; no README description or additional service wiring was available.

Main entry points: [`projet_mobile_prices.py`](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/projet_mobile_prices.py) (Phone feature form), [`train_model.py`](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/train_model.py) (Training pipeline), [`scaler.pkl`](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/scaler.pkl) (Saved scaler), [`modele.pkl`](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/modele.pkl) (Saved classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_dataset["Phone prices CSV<br/>[mobile_prices.csv]"]
  node_trainer["Training pipeline<br/>[train_model.py]"]
  node_scaler_file["Saved scaler<br/>[scaler.pkl]"]
  node_model_file["Saved classifier<br/>[modele.pkl]"]
end

subgraph group_inference["Prediction app"]
  node_form["Phone feature form"]
  node_transform["Feature scaling"]
  node_classifier["Price classifier"]
  node_result["Predicted price class"]
end

node_user(("User"))

node_trainer -->|"reads"| node_dataset
node_trainer -->|"saves scaler"| node_scaler_file
node_trainer -->|"saves model"| node_model_file
node_user -->|"enters features"| node_form
node_form -->|"submits features"| node_transform
node_form -->|"loads scaler"| node_scaler_file
node_form -->|"loads model"| node_model_file
node_transform -->|"scaled features"| node_classifier
node_classifier -->|"predicts class"| node_result
node_result -->|"displays result"| node_user

click node_dataset "https://github.com/saad-7-2020/projet_mobile_prices/blob/main/mobile_prices.csv"
click node_trainer "https://github.com/saad-7-2020/projet_mobile_prices/blob/main/train_model.py"
click node_scaler_file "https://github.com/saad-7-2020/projet_mobile_prices/blob/main/scaler.pkl"
click node_model_file "https://github.com/saad-7-2020/projet_mobile_prices/blob/main/modele.pkl"
click node_form "https://github.com/saad-7-2020/projet_mobile_prices/blob/main/projet_mobile_prices.py"
click node_transform "https://github.com/saad-7-2020/projet_mobile_prices/blob/main/projet_mobile_prices.py"
click node_classifier "https://github.com/saad-7-2020/projet_mobile_prices/blob/main/projet_mobile_prices.py"
click node_result "https://github.com/saad-7-2020/projet_mobile_prices/blob/main/projet_mobile_prices.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_dataset,node_trainer,node_scaler_file,node_model_file,node_user toneBlue
class node_form,node_transform,node_classifier,node_result toneAmber
```

## Components

### Model training

- [Phone prices CSV](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/mobile_prices.csv): `mobile_prices.csv`
- [Training pipeline](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/train_model.py): `train_model.py`
- [Saved scaler](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/scaler.pkl): `scaler.pkl`
- [Saved classifier](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/modele.pkl): `modele.pkl`

### Prediction app

- [Phone feature form](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/projet_mobile_prices.py): `projet_mobile_prices.py`
- [Feature scaling](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/projet_mobile_prices.py): `projet_mobile_prices.py`
- [Price classifier](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/projet_mobile_prices.py): `projet_mobile_prices.py`
- [Predicted price class](https://github.com/saad-7-2020/projet_mobile_prices/blob/main/projet_mobile_prices.py): `projet_mobile_prices.py`

### Other components

- **User**

## Connections

- Training pipeline → Phone prices CSV: reads (evidence: `train_model.py`)
- Training pipeline → Saved scaler: saves scaler (evidence: `train_model.py`)
- Training pipeline → Saved classifier: saves model (evidence: `train_model.py`)
- User → Phone feature form: enters features (evidence: `projet_mobile_prices.py`)
- Phone feature form → Feature scaling: submits features (evidence: `projet_mobile_prices.py`)
- Phone feature form → Saved scaler: loads scaler (evidence: `projet_mobile_prices.py`)
- Phone feature form → Saved classifier: loads model (evidence: `projet_mobile_prices.py`)
- Feature scaling → Price classifier: scaled features (evidence: `projet_mobile_prices.py`)
- Price classifier → Predicted price class: predicts class (evidence: `projet_mobile_prices.py`)
- Predicted price class → User: displays result (evidence: `projet_mobile_prices.py`)
