Skip to content

Predict diabetes risk using a Support Vector Machine model. Achieve high accuracy with medical indicators. Join us in this GitHub project! 🩺🤖

License

Notifications You must be signed in to change notification settings

LORD-BASALI-69/SVM-Diabetes-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SVM Diabetes Prediction: A Machine Learning Approach to Health 🩺

SVM Diabetes Prediction

Table of Contents

Project Overview

The SVM Diabetes Prediction project uses a Support Vector Machine (SVM) classifier to predict diabetes risk based on medical data. This model analyzes eight features from the Pima Indian dataset, including glucose levels, BMI, and age. The model achieves an accuracy of 75-80%.

For the latest release, visit here.

Features

  • Predictive Modeling: Uses SVM for accurate diabetes risk predictions.
  • Data Analysis: Evaluates eight key medical features.
  • User-Friendly: Simple interface for input and output.
  • Jupyter Notebook: Interactive environment for code and results.
  • Comprehensive Documentation: Guides users through setup and usage.

Technologies Used

  • Python: Main programming language for development.
  • scikit-learn: Library for machine learning algorithms.
  • pandas: For data manipulation and analysis.
  • NumPy: Supports numerical operations.
  • Jupyter Notebook: Provides an interactive coding environment.

Getting Started

To get started with the SVM Diabetes Prediction project, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/LORD-BASALI-69/SVM-Diabetes-Prediction.git
  2. Navigate to the Project Directory:

    cd SVM-Diabetes-Prediction
  3. Install Required Libraries: Use pip to install the necessary libraries:

    pip install -r requirements.txt
  4. Download the Latest Release: For the latest model and code, download from here.

Usage

To use the SVM Diabetes Prediction model, follow these steps:

  1. Open Jupyter Notebook: Start Jupyter Notebook in the project directory:

    jupyter notebook
  2. Load the Model: Open the provided notebook file and load the trained SVM model.

  3. Input Data: Enter the required medical features in the designated fields.

  4. Get Predictions: Run the prediction cell to see the diabetes risk result.

Data Preprocessing

Data preprocessing is crucial for effective model training. The following steps are taken:

  1. Data Cleaning:

    • Handle missing values by replacing them with the mean or median.
    • Remove duplicates to ensure data integrity.
  2. Feature Selection:

    • Select relevant features such as glucose, BMI, age, etc.
    • Drop irrelevant columns to reduce noise.
  3. Data Normalization:

    • Scale features to a standard range using Min-Max scaling or Standardization.
    • This helps the SVM model perform better.

Model Training

The model training process includes the following steps:

  1. Split the Data:

    • Divide the dataset into training and testing sets using an 80-20 split.
  2. Initialize the SVM Classifier:

    • Choose the appropriate kernel (linear, polynomial, etc.) based on data distribution.
  3. Train the Model:

    • Fit the SVM model on the training data.
    • Use cross-validation to ensure the model generalizes well.
  4. Save the Model:

    • Use joblib or pickle to save the trained model for future use.

Model Evaluation

Evaluating the model's performance is essential. The following metrics are used:

  1. Accuracy Score:

    • Calculate the accuracy of the model on the test set.
    • Aim for an accuracy between 75-80%.
  2. Confusion Matrix:

    • Visualize the performance of the model.
    • Helps identify false positives and negatives.
  3. Classification Report:

    • Provides precision, recall, and F1-score for better understanding.

Prediction System

The prediction system allows users to input medical data and receive predictions.

  1. Input Features:

    • Users enter values for glucose, BMI, age, etc.
  2. Run Prediction:

    • The model processes the input and returns the diabetes risk.
  3. Output:

    • The system displays whether the user is at risk for diabetes.

Contributing

Contributions are welcome. If you wish to contribute, please follow these steps:

  1. Fork the Repository: Click on the fork button at the top right of the repository page.

  2. Create a Branch: Create a new branch for your feature or bug fix.

    git checkout -b feature-name
  3. Make Changes: Implement your changes and commit them.

    git commit -m "Add new feature"
  4. Push Changes: Push your changes to your forked repository.

    git push origin feature-name
  5. Create a Pull Request: Go to the original repository and create a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or feedback, please reach out via GitHub.

For the latest release, visit here.

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •