Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
title: BodyFatPredictor
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: red
|
| 6 |
sdk: docker
|
|
@@ -12,9 +12,41 @@ short_description: Streamlit app with BodyFat (%) predictor
|
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: BodyFatPredictor
|
| 3 |
+
emoji: π§ββοΈ
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: red
|
| 6 |
sdk: docker
|
|
|
|
| 12 |
license: mit
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# π§ββοΈ BodyFat Predictor (Ridge Regression)
|
| 16 |
|
| 17 |
+
This app predicts **Body Fat Percentage (BodyFat %)** from anthropometric measurements using a trained **Ridge Regression** model.
|
| 18 |
|
| 19 |
+
It first predicts **Body Fat Density (Density)** and then converts it to **BodyFat (%)** using the Siri equation:
|
| 20 |
+
|
| 21 |
+
**BodyFat = 495 / Density β 450**
|
| 22 |
+
|
| 23 |
+
## β
Files
|
| 24 |
+
- `app.py` β Streamlit application
|
| 25 |
+
- `ridge_bodyfat_model.pkl` β trained Ridge model (must be in the same folder as `app.py`)
|
| 26 |
+
- `requirements.txt` β dependencies
|
| 27 |
+
|
| 28 |
+
## π Units (Important)
|
| 29 |
+
This project uses **imperial units** as in the dataset:
|
| 30 |
+
- **Height**: inches
|
| 31 |
+
- **Weight**: pounds (lbs)
|
| 32 |
+
- Other body measurements: typically inches (keep consistent with your dataset)
|
| 33 |
+
|
| 34 |
+
The app also supports engineered features:
|
| 35 |
+
- `Waist_hip = Abdomen / Hip`
|
| 36 |
+
- `Body_Index (BMI) = 703 * Weight / Height^2` (imperial BMI)
|
| 37 |
+
|
| 38 |
+
These are computed automatically **only if** your saved model expects them.
|
| 39 |
+
|
| 40 |
+
## π Run locally
|
| 41 |
+
```bash
|
| 42 |
+
pip install -r requirements.txt
|
| 43 |
+
streamlit run app.py
|
| 44 |
+
π§ Model
|
| 45 |
+
Algorithm: Ridge Regression
|
| 46 |
+
|
| 47 |
+
Target during training: Density
|
| 48 |
+
|
| 49 |
+
Submission output: BodyFat (%) using the Siri conversion
|
| 50 |
+
|
| 51 |
+
π Notes
|
| 52 |
+
If the app cannot detect feature names, re-train the model using a pandas DataFrame so scikit-learn stores feature_names_in_.
|