CoolFace
Modelpublic

kendrickfff/Disease-Progression-Prediction

sourceHugging Facemitupdated 7mo agoView on Hugging Face
0likes
Model Card

📉 Diabetes — Disease Progression Prediction (Linear Regression)

A Linear Regression model trained on the Diabetes dataset from Azure Open Datasets to predict Y (a quantitative measure of disease progression one year after baseline).

Built and deployed on Microsoft Fabric during Offline Workshop Training — organized by Microsoft Elevate and Dicoding.

📊 Model Details

PropertyValue
Model TypeLinear Regression
Frameworkscikit-learn
TaskTabular Regression
Target VariableY (disease progression, continuous)
Training PlatformMicrosoft Fabric + MLflow
DatasetDiabetes (Azure Open Datasets)
Total Samples442
Train/Test Split70/30 (random_state=0)

📝 Features (10)

FeatureTypeDescription
AGEintAge of patient
SEXintGender
BMIfloatBody Mass Index
BPfloatAverage Blood Pressure
S1intTotal Serum Cholesterol (tc)
S2floatLow-Density Lipoproteins (ldl)
S3floatHigh-Density Lipoproteins (hdl)
S4floatTotal Cholesterol / HDL (tch)
S5floatLog of Serum Triglycerides (ltg)
S6intBlood Sugar Level (glu)

📈 Performance

Best Model: Linear Regression

MetricScore
R² (Coefficient of Determination)0.3929
MAE (Mean Absolute Error)44.62
RMSE (Root Mean Squared Error)55.65
CV R² (5-fold)0.4823 ± 0.0493

All Models Compared

ModelMAERMSE
Linear Regression0.392944.6255.65
Random Forest0.301147.8659.71
XGBoost0.202648.9363.78
Gradient Boosting0.182351.4464.59
ℹ️ Note: An R² of ~0.39 is typical for clinical datasets where disease progression depends on many unmeasured factors (genetics, lifestyle, diet). Interestingly, Linear models outperform tree-based models here due to the small sample size (442 rows), avoiding overfitting.

💻 Usage

python
import pickle
import numpy as np

# Load model (ensure model.pkl is in the directory)
with open("model.pkl", "rb") as f:
    model = pickle.load(f)

# Input: [AGE, SEX, BMI, BP, S1, S2, S3, S4, S5, S6]
# Example: Patient with average stats
sample = np.array([[50, 1, 28.5, 90.0, 200, 120.5, 45.0, 4.5, 5.2, 95]])

# Predict Disease Progression
prediction = model.predict(sample)
print(f"Predicted Disease Progression (Y): {prediction[0]:.2f}")

🔍 Key Insights

  • S5 (Log of Serum Triglycerides) is the most important predictor by far (Coefficient: 65.8), indicating a strong correlation with disease progression.
  • SEX and BMI are the 2nd and 3rd most influential features.
  • Simplicity wins: Linear Regression outperforms complex ensemble models on this small dataset. Simpler models often generalize better when data is limited (n=442).
  • Stability: Cross-validation shows moderate stability (CV R² = 0.48 ± 0.05), suggesting the model is robust within its performance range.

⚖️ Feature Importance

Ranked by the absolute value of coefficients:

RankFeatureCoef (Abs)Impact
1S565.807⭐⭐⭐⭐⭐
2SEX18.445⭐⭐⭐
3BMI6.246⭐⭐
4S43.196
5BP0.938
6S10.694
7S20.378
8S30.257
9AGE0.191
10S60.111

⚠️ Intended Use

  • Primary: Educational / demonstration of ML workflow on Microsoft Fabric.
  • Not intended for: Clinical decision-making without further validation.

🙌 Acknowledgments

  • Microsoft Elevate and Dicoding — for organizing Offline Workshop Training.
  • Azure Open Datasets — for providing the Diabetes dataset.