CoolFace
Apppublic

Muneebk00/diabetes-progression-predictor

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

🩺 Diabetes Progression Predictor

About

This app predicts the diabetes disease progression score of a patient one year after baseline measurement. Users enter eight standardised health metrics via interactive sliders and receive an instant prediction score together with a colour-coded risk level (Low / Moderate / High). The entire pipeline — from data cleaning to model selection — is fully automated and reproducible.

Dataset

The app uses the sklearn built-in diabetes dataset (sklearn.datasets.load_diabetes), which contains 442 patient records with 10 physiological features (age, sex, BMI, blood pressure, and six serum measurements). The continuous regression target represents a quantitative measure of disease progression one year after the baseline visit.

Features Used

The top 8 features selected by SelectKBest with f_regression:

#FeatureDescription
1bmiBody mass index
2bpAverage blood pressure
3s1Total serum cholesterol
4s2Low-density lipoprotein (LDL)
5s3High-density lipoprotein (HDL)
6s4Total cholesterol / HDL ratio
7s5Log of serum triglycerides level
8s6Blood sugar level
Feature names are loaded dynamically from features.pkl — never hardcoded.

Model

Gradient Boosting Regressor (n_estimators=100, random_state=42) was chosen as the best model because it consistently achieved the highest R² score among the six candidates evaluated (Linear Regression, Ridge, Lasso, Decision Tree, Random Forest, Gradient Boosting). Gradient Boosting excels at capturing non-linear interactions between clinical features without requiring manual feature engineering.

Metrics

MetricValue
RMSE(run train.py to populate)
MAE(run train.py to populate)
(run train.py to populate)
Run python train.py to print exact metric values to the console.

How to Run Locally

bash
# 1. Install dependencies
pip install -r requirements.txt

# 2. Train the model and save artifacts
python train.py

# 3. Launch the Gradio dashboard
python app.py

The app opens automatically at http://127.0.0.1:7860.

Disclaimer

⚠️ This tool is for educational purposes only and does not constitute medical advice. Always consult a qualified healthcare professional for medical decisions.