Skip to content

Machine learning–based liver disease prediction using the Indian Liver Patient Dataset with comparison of six classification models.

Notifications You must be signed in to change notification settings

SahanaXRenukaB/Liver-Disease-Detection-Using-Ensemble-Machine-Learning-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Liver Disease Prediction Using Machine Learning 🩺

This project focuses on predicting liver disease using machine learning models trained on the Indian Liver Patient Dataset (ILPD). The objective is to assist early diagnosis by analyzing routine clinical and biochemical parameters.


Project Overview

Liver disease is a major health concern and often remains undiagnosed until advanced stages. This project applies supervised machine learning techniques to classify patients as having liver disease or not, based on medical test results.

Multiple models are trained, evaluated, and compared to identify the best-performing approach.


Dataset Information

  • Dataset: Indian Liver Patient Dataset (ILPD)
  • Records: 583
  • Features include:
    • Age
    • Gender
    • Total Bilirubin
    • Direct Bilirubin
    • Alkaline Phosphatase
    • ALT (SGPT)
    • AST (SGOT)
    • Total Proteins
    • Albumin
    • Albumin/Globulin Ratio
  • Target variable:
    • 1 → Liver Disease
    • 0 → No Liver Disease

Machine Learning Models Used

The following six models were implemented and compared:

  • Logistic Regression
  • K-Nearest Neighbors (KNN)
  • Support Vector Machine (SVM)
  • Decision Tree
  • Random Forest
  • XGBoost

Methodology

  1. Data loading and preprocessing
  2. Handling missing values and encoding categorical features
  3. Feature scaling and normalization
  4. Model training using multiple classifiers
  5. Performance evaluation and comparison
  6. Selection of the best-performing model

Evaluation Metrics

Models were evaluated using:

  • Accuracy
  • Precision
  • Recall
  • F1-score
  • Confusion Matrix

Results and Insights

  • Ensemble and tree-based models achieved higher accuracy
  • Bilirubin levels and liver enzyme values were strong predictors
  • Random Forest and XGBoost performed better than linear models
  • Comparing multiple models helped in selecting a reliable classifier

Technologies Used

  • Python
  • Jupyter Notebook
  • Pandas
  • NumPy
  • Scikit-learn
  • Matplotlib
  • Seaborn
  • XGBoost

Liver-Disease-Prediction/ │ ├── ILPD Final-6models.ipynb ├── dataset.csv └── README.md


Conclusion

This project demonstrates the effectiveness of machine learning techniques in medical diagnosis. By comparing multiple models, the system identifies the most suitable approach for liver disease prediction, supporting early detection and better healthcare outcomes.


Future Enhancements

  • Hyperparameter tuning
  • Handling class imbalance using SMOTE
  • Model deployment as a web application
  • Integration with real-time clinical data

Project Structure

About

Machine learning–based liver disease prediction using the Indian Liver Patient Dataset with comparison of six classification models.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors