Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,3 +11,204 @@ pinned: false
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 14 |
+
|
| 15 |
+
# AI Model Comparison App
|
| 16 |
+
|
| 17 |
+
A Machine Learning web application built using Python and Gradio.
|
| 18 |
+
This project allows users to compare multiple Machine Learning models on different datasets for both Classification and Regression tasks.
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# Features
|
| 23 |
+
|
| 24 |
+
## Classification
|
| 25 |
+
Users can choose one of the following datasets:
|
| 26 |
+
|
| 27 |
+
- Iris Dataset
|
| 28 |
+
- Breast Cancer Dataset
|
| 29 |
+
- Titanic Dataset
|
| 30 |
+
|
| 31 |
+
## Regression
|
| 32 |
+
Users can choose one of the following datasets:
|
| 33 |
+
|
| 34 |
+
- California Housing Dataset
|
| 35 |
+
- Diabetes Dataset
|
| 36 |
+
- Boston Housing Dataset
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
# Machine Learning Models
|
| 41 |
+
|
| 42 |
+
## Classification Models
|
| 43 |
+
|
| 44 |
+
- Logistic Regression
|
| 45 |
+
- Decision Tree Classifier
|
| 46 |
+
- Random Forest Classifier
|
| 47 |
+
- K-Nearest Neighbors (KNN)
|
| 48 |
+
|
| 49 |
+
## Regression Models
|
| 50 |
+
|
| 51 |
+
- Linear Regression
|
| 52 |
+
- Decision Tree Regressor
|
| 53 |
+
- Random Forest Regressor
|
| 54 |
+
- Support Vector Regressor (SVR)
|
| 55 |
+
|
| 56 |
+
---
|
| 57 |
+
|
| 58 |
+
# Technologies Used
|
| 59 |
+
|
| 60 |
+
- Python
|
| 61 |
+
- Scikit-learn
|
| 62 |
+
- Pandas
|
| 63 |
+
- Gradio
|
| 64 |
+
- Hugging Face Spaces
|
| 65 |
+
|
| 66 |
+
---
|
| 67 |
+
|
| 68 |
+
# Project Structure
|
| 69 |
+
|
| 70 |
+
```bash
|
| 71 |
+
├── app.py
|
| 72 |
+
├── requirements.txt
|
| 73 |
+
├── README.md
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
---
|
| 77 |
+
|
| 78 |
+
# Installation
|
| 79 |
+
|
| 80 |
+
## Clone the Repository
|
| 81 |
+
|
| 82 |
+
```bash
|
| 83 |
+
git clone https://github.com/your-username/your-repo-name.git
|
| 84 |
+
cd your-repo-name
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
## Install Required Libraries
|
| 88 |
+
|
| 89 |
+
```bash
|
| 90 |
+
pip install -r requirements.txt
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
## Run the Application
|
| 94 |
+
|
| 95 |
+
```bash
|
| 96 |
+
python app.py
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
---
|
| 100 |
+
|
| 101 |
+
# Hugging Face Deployment
|
| 102 |
+
|
| 103 |
+
## Steps
|
| 104 |
+
|
| 105 |
+
1. Create a new Space on Hugging Face
|
| 106 |
+
2. Choose:
|
| 107 |
+
- SDK: Gradio
|
| 108 |
+
3. Upload these files:
|
| 109 |
+
- app.py
|
| 110 |
+
- requirements.txt
|
| 111 |
+
- README.md
|
| 112 |
+
4. Wait for automatic deployment
|
| 113 |
+
|
| 114 |
+
---
|
| 115 |
+
|
| 116 |
+
# How the Application Works
|
| 117 |
+
|
| 118 |
+
## Step 1
|
| 119 |
+
Select the task type:
|
| 120 |
+
|
| 121 |
+
- Classification
|
| 122 |
+
- Regression
|
| 123 |
+
|
| 124 |
+
## Step 2
|
| 125 |
+
Choose a dataset
|
| 126 |
+
|
| 127 |
+
## Step 3
|
| 128 |
+
Click the button to run the models
|
| 129 |
+
|
| 130 |
+
## Step 4
|
| 131 |
+
The application will:
|
| 132 |
+
|
| 133 |
+
- Train multiple machine learning models
|
| 134 |
+
- Compare their performance
|
| 135 |
+
- Display the evaluation results
|
| 136 |
+
- Show the best-performing model
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
+
|
| 140 |
+
# Datasets Used
|
| 141 |
+
|
| 142 |
+
## Classification Datasets
|
| 143 |
+
|
| 144 |
+
### Iris Dataset
|
| 145 |
+
A famous dataset used for flower classification.
|
| 146 |
+
|
| 147 |
+
### Breast Cancer Dataset
|
| 148 |
+
Used to classify tumors as malignant or benign.
|
| 149 |
+
|
| 150 |
+
### Titanic Dataset
|
| 151 |
+
Predicts passenger survival on the Titanic.
|
| 152 |
+
|
| 153 |
+
---
|
| 154 |
+
|
| 155 |
+
## Regression Datasets
|
| 156 |
+
|
| 157 |
+
### California Housing Dataset
|
| 158 |
+
Predicts housing prices in California districts.
|
| 159 |
+
|
| 160 |
+
### Diabetes Dataset
|
| 161 |
+
Predicts disease progression measurements.
|
| 162 |
+
|
| 163 |
+
### Boston Housing Dataset
|
| 164 |
+
Predicts house prices using multiple features.
|
| 165 |
+
|
| 166 |
+
---
|
| 167 |
+
|
| 168 |
+
# Evaluation Metrics
|
| 169 |
+
|
| 170 |
+
## Classification
|
| 171 |
+
|
| 172 |
+
- Accuracy Score
|
| 173 |
+
|
| 174 |
+
## Regression
|
| 175 |
+
|
| 176 |
+
- R² Score
|
| 177 |
+
- Mean Squared Error (MSE)
|
| 178 |
+
|
| 179 |
+
---
|
| 180 |
+
|
| 181 |
+
# Future Improvements
|
| 182 |
+
|
| 183 |
+
- Add more datasets
|
| 184 |
+
- Add XGBoost and LightGBM
|
| 185 |
+
- Allow users to upload custom datasets
|
| 186 |
+
- Add graphs and visualizations
|
| 187 |
+
- Generate downloadable reports
|
| 188 |
+
- Deploy with a custom UI design
|
| 189 |
+
|
| 190 |
+
---
|
| 191 |
+
|
| 192 |
+
# Example Use Case
|
| 193 |
+
|
| 194 |
+
A user selects:
|
| 195 |
+
|
| 196 |
+
- Task Type: Classification
|
| 197 |
+
- Dataset: Iris Dataset
|
| 198 |
+
|
| 199 |
+
The app trains:
|
| 200 |
+
|
| 201 |
+
- Logistic Regression
|
| 202 |
+
- Decision Tree
|
| 203 |
+
- Random Forest
|
| 204 |
+
- KNN
|
| 205 |
+
|
| 206 |
+
Then compares their accuracy scores and displays the best model.
|
| 207 |
+
|
| 208 |
+
---
|
| 209 |
+
|
| 210 |
+
# Author
|
| 211 |
+
|
| 212 |
+
## Saja
|
| 213 |
+
|
| 214 |
+
- Master’s Student in Artificial Intelligence
|