Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,3 +11,68 @@ license: apache-2.0
|
|
| 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 |
+
---
|
| 16 |
+
title: Nutrition Density Prediction App
|
| 17 |
+
emoji: 🍏
|
| 18 |
+
colorFrom: "#4CAF50"
|
| 19 |
+
colorTo: "#8BC34A"
|
| 20 |
+
sdk: gradio
|
| 21 |
+
sdk_version: "3.0.0"
|
| 22 |
+
app_file: app.py
|
| 23 |
+
pinned: false
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# Nutrition Density Prediction App
|
| 27 |
+
|
| 28 |
+
This app predicts the **Nutrition Density** based on 10 selected nutrition features using either the **SVR** (Support Vector Regression) or **Linear Regression** model. The user can interact with the app by adjusting sliders for key nutrition features and selecting a model to predict the Nutrition Density.
|
| 29 |
+
|
| 30 |
+
## How It Works
|
| 31 |
+
|
| 32 |
+
1. **Model Selection**: Choose between two models - **SVR** or **Linear Regression**.
|
| 33 |
+
2. **Adjust Nutrition Features**: Adjust the following 10 key nutrition features using sliders:
|
| 34 |
+
- **Caloric Value**
|
| 35 |
+
- **Fat**
|
| 36 |
+
- **Saturated Fats**
|
| 37 |
+
- **Carbohydrates**
|
| 38 |
+
- **Sugars**
|
| 39 |
+
- **Protein**
|
| 40 |
+
- **Cholesterol**
|
| 41 |
+
- **Sodium**
|
| 42 |
+
- **Calcium**
|
| 43 |
+
- **Iron**
|
| 44 |
+
3. **Prediction**: Once the features are set, click on **"Predict"**. The selected model will calculate and display the Nutrition Density based on the inputs.
|
| 45 |
+
4. **Clear**: Reset the inputs to default values by clicking the **"Clear"** button.
|
| 46 |
+
|
| 47 |
+
## Deployment on Hugging Face Spaces
|
| 48 |
+
|
| 49 |
+
This app is deployed on [Hugging Face Spaces](https://huggingface.co/spaces), allowing users to interact with it easily via a web interface.
|
| 50 |
+
|
| 51 |
+
To use the app, follow these steps:
|
| 52 |
+
|
| 53 |
+
1. Visit the Hugging Face Spaces page for this app:
|
| 54 |
+
[Your Hugging Face Space Link](<Your Space URL>)
|
| 55 |
+
|
| 56 |
+
2. **Adjust the Sliders**: Choose your desired nutrition values for Caloric Value, Fat, Saturated Fats, Carbohydrates, Sugars, Protein, Cholesterol, Sodium, Calcium, and Iron.
|
| 57 |
+
|
| 58 |
+
3. **Select the Model**: Choose between **SVR** or **Linear Regression**.
|
| 59 |
+
|
| 60 |
+
4. **Click "Predict"**: The app will calculate the Nutrition Density based on your selections.
|
| 61 |
+
|
| 62 |
+
5. **Clear Inputs**: Reset all values to their initial state by clicking the **"Clear"** button.
|
| 63 |
+
|
| 64 |
+
## How to Run Locally (Optional)
|
| 65 |
+
|
| 66 |
+
If you'd like to run the app on your local machine, follow these instructions:
|
| 67 |
+
|
| 68 |
+
### Prerequisites
|
| 69 |
+
|
| 70 |
+
- Python 3.x
|
| 71 |
+
|
| 72 |
+
### Installation Steps
|
| 73 |
+
|
| 74 |
+
1. Clone the repository:
|
| 75 |
+
```bash
|
| 76 |
+
git clone <repository_url>
|
| 77 |
+
cd <project_directory>
|
| 78 |
+
|