Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🩺 Diabetes Prediction using Logistic Regression

This project implements a binary classification model using Logistic Regression to predict whether a person is diabetic or non-diabetic based on medical diagnostic measurements. The model is trained and evaluated using the Pima Indians Diabetes Dataset.


🚀 Features

  • Binary classification using Logistic Regression

  • Uses real-world medical data (Pima Indians Diabetes Dataset)

  • Model evaluation with:

    • Accuracy Score
    • Confusion Matrix
    • Classification Report (Precision, Recall, F1-score)
  • Visualizes confusion matrix using Seaborn heatmap

  • Predicts diabetes outcome for new patient data


🧠 Dataset Information

Pima Indians Diabetes Dataset contains medical records of female patients and includes the following features:

  • Pregnancies
  • Glucose
  • Blood Pressure
  • Skin Thickness
  • Insulin
  • BMI (Body Mass Index)
  • Diabetes Pedigree Function
  • Age

Target Variable:

  • Outcome

    • 1 → Diabetic
    • 0 → Non-Diabetic

Dataset Source:

  • UCI Machine Learning Repository (via Kaggle & GitHub)

⚙️ How the Model Works

  1. Dataset is loaded directly from an online CSV source.
  2. Features (X) and target (y) are separated.
  3. Data is split into training and testing sets (80% / 20%).
  4. Logistic Regression model is trained on the training data.
  5. Predictions are made on the test set.
  6. Model performance is evaluated using accuracy and classification metrics.
  7. Confusion matrix is visualized using a heatmap.
  8. Model predicts diabetes status for new patient data.

📂 Project Structure

├── diabetes_prediction.py
├── README.md

🛠️ Requirements

Install the required Python libraries:

pip install pandas scikit-learn seaborn matplotlib

▶️ How to Run

  1. Clone the repository or download the script.
  2. Navigate to the project directory.
  3. Run the Python file:
python diabetes_prediction.py

📊 Sample Output

  • Displays the first few rows of the dataset

  • Prints:

    • Accuracy percentage
    • Confusion matrix
    • Classification report
  • Shows a heatmap of the confusion matrix

  • Outputs predicted diabetes status for new input data


📌 Example Prediction

Predicted diabetes outcome for the new data: Non-Diabetic

⚠️ Disclaimer

This project is intended for educational purposes only. It should not be used for real medical diagnosis. Medical decisions should always be made by qualified healthcare professionals.


👨‍💻 Author

Abdullah Ali Learning Machine Learning & Data Science 🚀


⭐ If you find this project helpful, consider starring the repository!

About

A binary classification model using Logistic Regression to predict whether a person is diabetic or non-diabetic based on medical diagnostic measurements

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages