Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
---
|
| 2 |
title: MobilePriceClassification
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
app_port: 8501
|
| 8 |
tags:
|
|
@@ -12,9 +12,56 @@ short_description: Classifies smartphone price ranges using a KNN model.
|
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
| 16 |
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: MobilePriceClassification
|
| 3 |
+
emoji: π±
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: docker
|
| 7 |
app_port: 8501
|
| 8 |
tags:
|
|
|
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# π± Smartphone Price Range Classification
|
| 16 |
|
| 17 |
+
This project is a **machine learning web application** that predicts the **price range of a smartphone**
|
| 18 |
+
based on its technical specifications such as RAM, battery power, screen resolution, and connectivity features.
|
| 19 |
|
| 20 |
+
Instead of predicting the exact price, the model classifies smartphones into one of four predefined categories.
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## π― Price Categories
|
| 25 |
+
|
| 26 |
+
- **0** β Low Cost
|
| 27 |
+
- **1** β Medium Cost
|
| 28 |
+
- **2** β High Cost
|
| 29 |
+
- **3** β Very High Cost
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## π€ Model Overview
|
| 34 |
+
|
| 35 |
+
- **Algorithm:** K-Nearest Neighbors (KNN)
|
| 36 |
+
- **Preprocessing:** StandardScaler
|
| 37 |
+
- **Task Type:** Multi-class classification
|
| 38 |
+
- **Dataset Size:** 2,000 smartphones with 20 technical features
|
| 39 |
+
|
| 40 |
+
The KNN model achieved **high accuracy and balanced performance** across all price categories.
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## π How the App Works
|
| 45 |
+
|
| 46 |
+
1. The user enters smartphone specifications.
|
| 47 |
+
2. The input data is scaled using the same scaler as during training.
|
| 48 |
+
3. The trained KNN model predicts the price range.
|
| 49 |
+
4. The predicted class and label are displayed instantly.
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
## π Project Files
|
| 54 |
+
|
| 55 |
+
- `app.py` β Streamlit application
|
| 56 |
+
- `knn_model.pkl` β Trained KNN model
|
| 57 |
+
- `knn_scaler.pkl` β Fitted StandardScaler
|
| 58 |
+
- `knn_features.pkl` β Feature names and correct input order
|
| 59 |
+
- `requirements.txt` β Python dependencies
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
## βΆοΈ Run Locally
|
| 64 |
+
|
| 65 |
+
```bash
|
| 66 |
+
pip install -r requirements.txt
|
| 67 |
+
streamlit run app.py
|