Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📈 Diabetes Prediction using Logistic Regression

📌 Project Overview

This project uses Logistic Regression to predict whether a patient has diabetes based on the Pima Indians Diabetes Dataset.

The project demonstrates a complete machine learning workflow, including data preprocessing, feature scaling, probability prediction, ROC curve analysis, and model evaluation.


📂 Dataset

  • Dataset: Pima Indians Diabetes Database
  • Target Variable: Outcome
    • 0: Non-Diabetic
    • 1: Diabetic

Features include:

  • Pregnancies
  • Glucose
  • BloodPressure
  • SkinThickness
  • Insulin
  • BMI
  • DiabetesPedigreeFunction
  • Age

🛠️ Technologies Used

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

📊 Project Workflow

  • Load the dataset
  • Exploratory Data Analysis (EDA)
  • Data cleaning
  • Train-Test Split
  • Feature Scaling using StandardScaler
  • Train a Logistic Regression model
  • Probability prediction
  • Model evaluation
  • ROC Curve and AUC Score

📈 Results

  • Accuracy: 70.8%
  • AUC Score: 0.815
  • Confusion Matrix
  • Classification Report
  • ROC Curve

📊 Model Comparison

Model Accuracy
K-Nearest Neighbors 79.2%
Decision Tree 78.6%
Random Forest 76.0%
Logistic Regression 70.8%

Although Logistic Regression achieved the lowest accuracy among the four models, it provides probability estimates and performs well according to the AUC score (0.815). This makes it a valuable baseline model and an excellent choice when interpretability and probability estimation are important.


🚀 Key Learning Outcomes

Through this project, I learned how to:

  • Train a Logistic Regression model
  • Apply feature scaling using StandardScaler
  • Predict class probabilities
  • Evaluate a classifier using Accuracy, Precision, Recall and F1-score
  • Understand ROC Curve and AUC Score
  • Compare multiple machine learning algorithms

📁 Project Structure

Project_04_Diabetes/
│
├── diabetes_logistic_regression.ipynb
├── diabetes.csv
├── README.md
├── requirements.txt
└── .gitignore

👨‍💻 Author

Taha Lazar

About

Diabetes prediction using Logistic Regression with feature scaling, probability prediction, ROC Curve, AUC analysis, and model evaluation using Python and Scikit-learn.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages