# vishwanatha-14/ml2-mini architecture

> Architecture diagram of the GitHub repository vishwanatha-14/ml2-mini, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vishwanatha-14/ml2-mini
- Repository: https://github.com/vishwanatha-14/ml2-mini

## Overview

This repository trains and compares five classifiers for four mobile-phone price ranges, then exposes saved models through a prediction CLI. The main workflow is specification data → cleaning and stratified split → model training and tuning → shared evaluation and saved artifacts → prediction for a new phone. The README also documents notebook-based EDA. Source excerpts support the training, evaluation, and prediction connections; notebook internals and artifact contents were not inspected.

Main entry points: [`src/train.py`](https://github.com/vishwanatha-14/ml2-mini/blob/main/src/train.py) (Train and tune), [`src/predict.py`](https://github.com/vishwanatha-14/ml2-mini/blob/main/src/predict.py) (Prediction CLI), [`src/evaluate.py`](https://github.com/vishwanatha-14/ml2-mini/blob/main/src/evaluate.py) (Metrics and plots), [`src/preprocessing.py`](https://github.com/vishwanatha-14/ml2-mini/blob/main/src/preprocessing.py) (Clean and split)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and EDA"]
  node_phone_data["Training data<br/>[train.csv]"]
  node_preprocessing["Clean and split<br/>[preprocessing.py]"]
  node_eda["Exploratory analysis"]
end

subgraph group_training["Model training"]
  node_training_pipeline["Train and tune<br/>[train.py]"]
  node_models["Saved classifiers"]
end

subgraph group_serving["Evaluation and prediction"]
  node_evaluation["Metrics and plots<br/>[evaluate.py]"]
  node_results["Comparison outputs"]
  node_prediction_cli["Prediction CLI<br/>[predict.py]"]
  node_price_result["Price range and probabilities<br/>[predict.py]"]
end

node_analyst(("Analyst"))
node_new_phone(("Phone specifications"))

node_training_pipeline -->|"reads"| node_phone_data
node_training_pipeline -->|"cleans and splits"| node_preprocessing
node_training_pipeline -->|"calls"| node_evaluation
node_training_pipeline -->|"saves"| node_models
node_training_pipeline -->|"writes"| node_results
node_evaluation -->|"writes reports"| node_results
node_analyst -->|"runs training"| node_training_pipeline
node_analyst -->|"requests prediction"| node_prediction_cli
node_new_phone -->|"provides specs"| node_prediction_cli
node_prediction_cli -->|"loads model"| node_models
node_prediction_cli -->|"uses labels and features"| node_preprocessing
node_prediction_cli -->|"returns prediction"| node_price_result
node_analyst -->|"explores data"| node_eda

click node_phone_data "https://github.com/vishwanatha-14/ml2-mini/blob/main/data/train.csv"
click node_preprocessing "https://github.com/vishwanatha-14/ml2-mini/blob/main/src/preprocessing.py"
click node_eda "https://github.com/vishwanatha-14/ml2-mini/blob/main/notebooks/mobile_price_classification.ipynb"
click node_training_pipeline "https://github.com/vishwanatha-14/ml2-mini/blob/main/src/train.py"
click node_models "https://github.com/vishwanatha-14/ml2-mini/tree/main/models"
click node_evaluation "https://github.com/vishwanatha-14/ml2-mini/blob/main/src/evaluate.py"
click node_results "https://github.com/vishwanatha-14/ml2-mini/tree/main/results"
click node_prediction_cli "https://github.com/vishwanatha-14/ml2-mini/blob/main/src/predict.py"
click node_price_result "https://github.com/vishwanatha-14/ml2-mini/blob/main/src/predict.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_phone_data,node_preprocessing,node_eda toneBlue
class node_training_pipeline,node_models toneAmber
class node_evaluation,node_results,node_prediction_cli,node_price_result toneMint
class node_analyst,node_new_phone toneIndigo
```

## Components

### Data and EDA

- [Training data](https://github.com/vishwanatha-14/ml2-mini/blob/main/data/train.csv): `data/train.csv`
- [Clean and split](https://github.com/vishwanatha-14/ml2-mini/blob/main/src/preprocessing.py): `src/preprocessing.py`
- [Exploratory analysis](https://github.com/vishwanatha-14/ml2-mini/blob/main/notebooks/mobile_price_classification.ipynb): `notebooks/mobile_price_classification.ipynb`

### Model training

- [Train and tune](https://github.com/vishwanatha-14/ml2-mini/blob/main/src/train.py): `src/train.py`
- [Saved classifiers](https://github.com/vishwanatha-14/ml2-mini/tree/main/models): `models`

### Evaluation and prediction

- [Metrics and plots](https://github.com/vishwanatha-14/ml2-mini/blob/main/src/evaluate.py): `src/evaluate.py`
- [Comparison outputs](https://github.com/vishwanatha-14/ml2-mini/tree/main/results): `results`
- [Prediction CLI](https://github.com/vishwanatha-14/ml2-mini/blob/main/src/predict.py): `src/predict.py`
- [Price range and probabilities](https://github.com/vishwanatha-14/ml2-mini/blob/main/src/predict.py): `src/predict.py`

### Other components

- **Analyst**
- **Phone specifications**

## Connections

- Train and tune → Training data: reads (evidence: `src/train.py`)
- Train and tune → Clean and split: cleans and splits (evidence: `src/train.py`)
- Train and tune → Metrics and plots: calls (evidence: `src/train.py`)
- Train and tune → Saved classifiers: saves (evidence: `src/train.py`)
- Train and tune → Comparison outputs: writes (evidence: `src/train.py`)
- Metrics and plots → Comparison outputs: writes reports (evidence: `src/evaluate.py`)
- Analyst → Train and tune: runs training (evidence: `README.md`)
- Analyst → Prediction CLI: requests prediction (evidence: `README.md`)
- Phone specifications → Prediction CLI: provides specs (evidence: `src/predict.py`)
- Prediction CLI → Saved classifiers: loads model (evidence: `src/predict.py`)
- Prediction CLI → Clean and split: uses labels and features (evidence: `src/predict.py`)
- Prediction CLI → Price range and probabilities: returns prediction (evidence: `src/predict.py`)
- Analyst → Exploratory analysis: explores data (evidence: `README.md`)
