Skip to content

Repository files navigation

🧬 Liver Disease Prediction with Machine Learning

This project applies machine learning models to predict liver disease using the Indian Liver Patient Dataset (ILPD). It focuses on optimizing recall for early detection while maintaining model interpretability using SHAP analysis.


📁 Dataset

  • Source: UCI ILPD Dataset
  • Records: 583 patients (416 with liver disease, 167 without)

🧠 Models Used

  • Logistic Regression
  • Random Forest
  • XGBoost (final selected model)

📊 Performance Highlights

  • XGBoost ROC AUC: 0.7341
  • Recall (Liver Disease class): 90%
  • Threshold-Optimized for Sensitivity
  • SHAP explainability used to identify key biomarkers

⚙️ Key Techniques

  • Stratified train-test split & cross-validation
  • Feature scaling & encoding
  • Classification report, confusion matrix, ROC curve
  • SHAP summary & force plots for interpretability
  • Threshold tuning using F1-maximizing precision-recall analysis

📌 Final Takeaway

XGBoost was selected for its high recall, making it ideal for screening applications where minimizing false negatives is critical. SHAP plots were used to interpret the model’s focus on biomarkers like bilirubin, SGOT, SGPT, and albumin.


📊 Visual Results

Feature Importance

Feature Importance

ROC Curve Comparison between Accuracy-Optimized and F1-Optimized Thresholds:

ROC Curve accuracy_optimised and f1

ROC Curve Comparison between Random Forest, Logistic Regression and XGBoost:

ROC Curve

SHAP Heatmap

SHAP Heatmap

SHAP Forceplot

SHAP Forceplot


🧪 Key Biomarkers Identified (via SHAP)

  • Total Bilirubin
  • Direct Bilirubin
  • SGOT (AST)
  • SGPT (ALT)
  • Albumin
  • Albumin/Globulin Ratio

These features consistently contributed most to the model’s predictions, highlighting their clinical relevance in early detection of liver disease.


💡 Future Plans for This Project

  • Hyperparameter tuning (Optuna/GridSearchCV)
  • Handling class imbalance with SMOTE/ADASYN
  • Deploying via Streamlit for interactive clinical screening
  • External validation on new liver health datasets

About

ML model for detecting liver disease using the ILPD dataset with XGBoost & SHAP interpretability

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages