Muneebk00/diabetes-progression-predictor
🩺 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:
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
Run python train.py to print exact metric values to the console.How to Run Locally
# 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.pyThe 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.
