Spaces:
Sleeping
A newer version of the Gradio SDK is available: 6.13.0
title: Nutrition Regression
emoji: π
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 5.16.0
app_file: app.py
pinned: false
license: apache-2.0
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
title: Nutrition Density Prediction App emoji: π colorFrom: "#4CAF50" colorTo: "#8BC34A" sdk: gradio sdk_version: "3.0.0" app_file: app.py pinned: false
Nutrition Density Prediction App
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.
How It Works
- Model Selection: Choose between two models - SVR or Linear Regression.
- Adjust Nutrition Features: Adjust the following 10 key nutrition features using sliders:
- Caloric Value
- Fat
- Saturated Fats
- Carbohydrates
- Sugars
- Protein
- Cholesterol
- Sodium
- Calcium
- Iron
- Prediction: Once the features are set, click on "Predict". The selected model will calculate and display the Nutrition Density based on the inputs.
- Clear: Reset the inputs to default values by clicking the "Clear" button.
Deployment on Hugging Face Spaces
This app is deployed on Hugging Face Spaces, allowing users to interact with it easily via a web interface.
To use the app, follow these steps:
Visit the Hugging Face Spaces page for this app:
Your Hugging Face Space LinkAdjust the Sliders: Choose your desired nutrition values for Caloric Value, Fat, Saturated Fats, Carbohydrates, Sugars, Protein, Cholesterol, Sodium, Calcium, and Iron.
Select the Model: Choose between SVR or Linear Regression.
Click "Predict": The app will calculate the Nutrition Density based on your selections.
Clear Inputs: Reset all values to their initial state by clicking the "Clear" button.
How to Run Locally (Optional)
If you'd like to run the app on your local machine, follow these instructions:
Prerequisites
- Python 3.x
Installation Steps
- Clone the repository:
git clone <repository_url> cd <project_directory>