This project leverages the Body Fat Prediction dataset from Kaggle, which includes anthropometric measurements (e.g., height, weight, waist) to predict body fat percentage using machine learning.
🎯 Build a machine learning model to estimate body fat percentage from physical measurements.
- 🏋️ Fitness & Health: Personalize diet and exercise plans.
- 🏥 Medical Diagnosis: Assess risks for obesity-related conditions.
- 🏆 Sports Optimization: Ideal body composition for athletic performance.
- 💰 Insurance: Risk-based premium adjustment.
- Motivation: Replace expensive tools (DEXA) with scalable solutions.
- Use Case: Gyms or fitness apps provide instant assessments.
- Value: Low-cost health insights boost engagement and subscriptions.
- Use Case: Scalable B2B solutions for clinics, schools, or corporations.
- Value: Enables health monitoring at scale without medical devices.
- Use Case: Tailored plans (meals, workouts, apparel) based on body fat.
- Value: Higher customer satisfaction → more conversions and loyalty.
- Use Case: More accurate risk profiling than BMI alone.
- Value: Better risk management for insurers, better outcomes for health programs.
- 📂 Source: Kaggle – Body Fat Prediction
- 💾 Size: 436 samples, 16 columns
- 🧪 Features:
- Target: BodyFat (percentage)
- Inputs: Age, Weight, Height, Abdomen, Chest, Neck, Thigh, Hip, etc.
-
Dataset was clean, numeric, and no nulls.
-
Visualizations revealed normal distributions with minor skewness.
-
Strong correlations:
- Negative: BodyFat vs Density
- Positive: Abdomen & Chest vs BodyFat
-
Sex-based analysis showed anatomical differences, but Sex had a weak impact on body fat prediction.
📈 Key Insights:
- Abdomen circumference is the strongest single predictor.
- Weight correlates more with muscle mass than fat.
Custom features:
bmi = Weight / (Height/100)^2waist_to_hip = Abdomen / Hipwaist_to_height = Abdomen / Heightarm_ratio = Forearm / Biceps
Started simple due to data size:
- ✅ Linear Regression (baseline)
- ✅ SVR + RFE + PCA (enhanced model)
- ✅ Separate models: Male / Female / Combined
Metrics:
- MAE, RMSE, R²
- Evidently AI reports for:
- Data Drift
- Target Drift
- Regression Performance
- ⚙️ Data Processing: Polars, Scikit-Learn
- 🔁 Workflow: Metaflow
- 📊 Experiment Tracking: MLflow
- 🔍 Monitoring: Evidently AI
- 🧪 Tuning: Optuna
- 📦 API: FastAPI
- 📤 Serving: Streamlit dashboard
- 📂 Model Storage: joblib + MLflow Artifacts
# Docker Deployment
docker-compose up --build # First time
docker-compose up # Regular run
# Local Access
http://localhost:8000 # Web form
http://localhost:8000/docs # Swagger UI
Sample curl request:
curl -X POST "http://localhost:8000/predict/" \
-H "accept: application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "abdomen=110&hip=120&weight=100&thigh=190&knee=50&biceps=38&neck=45"- ✅ Accurate prediction of body fat percentage
- ✅ Feature-based health insights using anthropometric measurements
- ✅ Scalable FastAPI for real-world integration (web & REST)
- ✅ Visual analytics using Evidently AI for drift detection and retraining triggers
| Name | Video Link | |
|---|---|---|
| Igor Bak | [email protected] | 283 |
| Alejandro Castellanos | [email protected] | 283 |
| Faisal Khan | [email protected] | 283 |
| Hassan Saade | [email protected] | 283 |
| Anna Wong | [email protected] | 283 |