# arun-paulraj/mobile-price-classification architecture

> Architecture diagram of the GitHub repository arun-paulraj/mobile-price-classification, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arun-paulraj/mobile-price-classification
- Repository: https://github.com/arun-paulraj/mobile-price-classification

## Overview

This repository is a Streamlit mobile-price classification application. Users can explore the training data and published classifier metrics, evaluate an uploaded labeled dataset, or enter phone specifications and receive a price category with confidence. The runtime is concentrated in app.py; it loads trained model artifacts and a scaler, and reads CSV data for the overview and comparison pages. The README documents additional evaluation views, while the excerpts show only portions of their implementation, so those capabilities are represented at the application level.

Main entry points: [`app.py`](https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py) (Uploaded test evaluation), [`model/scaler.pkl`](https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/scaler.pkl) (Feature scaler), [`model/logistic_regression.pkl`](https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/logistic_regression.pkl) (Logistic regression), [`data/train.csv`](https://github.com/arun-paulraj/mobile-price-classification/blob/main/data/train.csv) (Training dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Streamlit application"]
  node_app["Streamlit pages<br/>[app.py]"]
  node_overview["Dataset overview<br/>[app.py]"]
  node_comparison["Model comparison<br/>[app.py]"]
  node_evaluation["Uploaded test evaluation<br/>[app.py]"]
  node_prediction["Feature prediction<br/>[app.py]"]
  node_results["Metrics and prediction results<br/>[app.py]"]
end

subgraph group_data["Datasets and metrics"]
  node_train_data[("Training dataset<br/>[train.csv]")]
  node_metrics_data[("Performance metrics<br/>[metrics.csv]")]
end

subgraph group_models["Classification artifacts"]
  node_scaler["Feature scaler<br/>[scaler.pkl]"]
  node_logistic["Logistic regression"]
  node_decision_tree["Decision tree"]
  node_knn["K-nearest neighbors<br/>[knn_classifier.pkl]"]
  node_naive_bayes["Naive Bayes"]
  node_svm["Support vector machine<br/>[svm_classifier.pkl]"]
end

node_user(("Application user"))
node_test_upload["Labeled test CSV"]

node_user -->|"selects page"| node_app
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_comparison
node_app -->|"routes to"| node_evaluation
node_app -->|"routes to"| node_prediction
node_overview -->|"reads"| node_train_data
node_comparison -->|"reads"| node_metrics_data
node_user -->|"uploads"| node_test_upload
node_test_upload -->|"provides data"| node_evaluation
node_evaluation -->|"transforms features"| node_scaler
node_evaluation -->|"loads selected model"| node_logistic
node_evaluation -->|"loads selected model"| node_decision_tree
node_evaluation -->|"loads selected model"| node_knn
node_evaluation -->|"loads selected model"| node_naive_bayes
node_evaluation -->|"loads selected model"| node_svm
node_evaluation -->|"displays metrics"| node_results
node_user -->|"enters specifications"| node_prediction
node_prediction -->|"transforms features"| node_scaler
node_prediction -->|"predicts category"| node_logistic
node_prediction -->|"shows category and confidence"| node_results
node_comparison -->|"visualizes metric"| node_results
node_overview -.->|"shows dataset details"| node_results
node_evaluation -->|"shows confusion matrix and report"| node_results

click node_app "https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py"
click node_overview "https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py"
click node_comparison "https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py"
click node_evaluation "https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py"
click node_prediction "https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py"
click node_results "https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py"
click node_train_data "https://github.com/arun-paulraj/mobile-price-classification/blob/main/data/train.csv"
click node_metrics_data "https://github.com/arun-paulraj/mobile-price-classification/blob/main/data/metrics.csv"
click node_scaler "https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/scaler.pkl"
click node_logistic "https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/logistic_regression.pkl"
click node_decision_tree "https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/decision_tree_classifier.pkl"
click node_knn "https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/knn_classifier.pkl"
click node_naive_bayes "https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/naive_bayes_classifier.pkl"
click node_svm "https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/svm_classifier.pkl"

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_app,node_overview,node_comparison,node_evaluation,node_prediction,node_results,node_user toneBlue
class node_train_data,node_metrics_data toneAmber
class node_scaler,node_logistic,node_decision_tree,node_knn,node_naive_bayes,node_svm toneMint
class node_test_upload toneIndigo
```

## Components

### Streamlit application

- [Streamlit pages](https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py): `app.py`
- [Dataset overview](https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py): `app.py`
- [Model comparison](https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py): `app.py`
- [Uploaded test evaluation](https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py): `app.py`
- [Feature prediction](https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py): `app.py`
- [Metrics and prediction results](https://github.com/arun-paulraj/mobile-price-classification/blob/main/app.py): `app.py`

### Datasets and metrics

- [Training dataset](https://github.com/arun-paulraj/mobile-price-classification/blob/main/data/train.csv): `data/train.csv`
- [Performance metrics](https://github.com/arun-paulraj/mobile-price-classification/blob/main/data/metrics.csv): `data/metrics.csv`

### Classification artifacts

- [Feature scaler](https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/scaler.pkl): `model/scaler.pkl`
- [Logistic regression](https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/logistic_regression.pkl): `model/logistic_regression.pkl`
- [Decision tree](https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/decision_tree_classifier.pkl): `model/decision_tree_classifier.pkl`
- [K-nearest neighbors](https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/knn_classifier.pkl): `model/knn_classifier.pkl`
- [Naive Bayes](https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/naive_bayes_classifier.pkl): `model/naive_bayes_classifier.pkl`
- [Support vector machine](https://github.com/arun-paulraj/mobile-price-classification/blob/main/model/svm_classifier.pkl): `model/svm_classifier.pkl`

### Other components

- **Application user**
- **Labeled test CSV**

## Connections

- Application user → Streamlit pages: selects page (evidence: `app.py`)
- Streamlit pages → Dataset overview: routes to (evidence: `app.py`)
- Streamlit pages → Model comparison: routes to (evidence: `app.py`)
- Streamlit pages → Uploaded test evaluation: routes to (evidence: `app.py`)
- Streamlit pages → Feature prediction: routes to (evidence: `app.py`)
- Dataset overview → Training dataset: reads (evidence: `app.py`)
- Model comparison → Performance metrics: reads (evidence: `app.py`)
- Application user → Labeled test CSV: uploads
- Labeled test CSV → Uploaded test evaluation: provides data (evidence: `app.py`)
- Uploaded test evaluation → Feature scaler: transforms features (evidence: `app.py`)
- Uploaded test evaluation → Logistic regression: loads selected model (evidence: `app.py`)
- Uploaded test evaluation → Decision tree: loads selected model (evidence: `app.py`)
- Uploaded test evaluation → K-nearest neighbors: loads selected model (evidence: `app.py`)
- Uploaded test evaluation → Naive Bayes: loads selected model (evidence: `app.py`)
- Uploaded test evaluation → Support vector machine: loads selected model (evidence: `app.py`)
- Uploaded test evaluation → Metrics and prediction results: displays metrics (evidence: `app.py`)
- Application user → Feature prediction: enters specifications (evidence: `app.py`)
- Feature prediction → Feature scaler: transforms features (evidence: `app.py`)
- Feature prediction → Logistic regression: predicts category (evidence: `app.py`)
- Feature prediction → Metrics and prediction results: shows category and confidence (evidence: `app.py`)
- Model comparison → Metrics and prediction results: visualizes metric (evidence: `app.py`)
- Dataset overview → Metrics and prediction results: shows dataset details (evidence: `README.md`)
- Uploaded test evaluation → Metrics and prediction results: shows confusion matrix and report (evidence: `app.py`)
