Skip to content

SiddharthBahuguna/Diabetes-Prediction-Using-Machine-Learning

Repository files navigation

Diabetes Prediction Using Machine Learning

🔮 Welcome to the Diabetes Prediction project! This repository predicts diabetes using the PIMA Indians Diabetes Database.

$~$

📁 Project Structure

|__ data/
|   |__ diabetes.csv
|   
|__ gui/
|   |__ gui.py
|   |__ gui_ctk.py
|
|__ flask/
|   |__ app.py
|   |__ templates/
|       |__ index.html
|       |__ result.html
|
|__ api/
|   |__ main.py
|   
|__ streamlit/
|   |__ app.py
|   |__ page/
|       |__  build.py
|       |__  predict.py
|       |__  visualize.py
|
|__ model/
|   |__ model_joblib_diabetes
|
|__ Diabetes Prediction + Gradio Interface.ipynb 
|__ Diabetes Prediction.ipynb
|__ EDA_of_the_dataset.ipynb
|__ LICENSE
|__ README.md
|__ .gitignore
|__ CODE_OF_CONDUCT.md
|__ CONTRIBUTING.md

$~$

🚀 Installation

  1. Clone the repository:

    git clone https://github.com/your-username/diabetes-prediction.git
    cd diabetes-prediction
  2. Set up virtual environment (optional but recommended):

    python -m venv .venv
    source .venv/bin/activate  # On Windows use .venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
    pip install --upgrade numpy

    NOTE

    Make sure you have installed numpy>=2.0.0 (pip will raise a dependency conflict error since ydata-profiling currently requires numpy<2, >=1.16 but that's not a problem for this project)

$~$

🎥 Video Demonstration

Link - https://www.dropbox.com/scl/fi/0hzpegrryti8kt9cfh5nu/Video-Demonstration.mp4?rlkey=jdhznsiuf2hlebrose42onep1&st=m056xdt8&dl=0

$~$

📊 How to Run Jupyter Notebook

  • Start Jupyter Notebook server:
    jupyter notebook
  • Navigate to Diabetes Prediction.ipynb and run the cells.

🖥️ How to Run GUI App

  • Navigate to the gui folder:
    cd gui
  • Run the GUI (Tkinter) application:
    python gui.py
  • Run the GUI (Custom Tkinter) application:
    python gui_ctk.py

🌐 How to Run Flask Web App

  • Navigate to the flask folder:
    cd flask
  • Run the flask application:
    python app.py

How to Run Streamlit Web App 📊 🛠️ 🔎

  • Navigate to the streamlit folder:
    cd streamlit
  • Run the streamlit application:
    streamlit run app.py
  • Wait for the pages to load
    • Predict from the pre-existing model
    • Build your own (Random Forest Classifier) model and get insights on it
    • Visualize any dataset by generating its Exploratory Data Analysis

🌐 How to Run FastAPI API

  • Navigate to the api folder:
    cd api
  • Run the FastAPI application:
    fastapi dev main.py

$~$

📸 Screenshots

Tkinter UI

nd

Gradio UI

Gradio UI

Flask Web App

Screenshot_26-6-2024_95820_127 0 0 1 Screenshot_26-6-2024_95830_127 0 0 1

FastAPI API

image image

EDA Screenshots


Click and Zoom on the Image for Better Visibility

Histogram

Histogram


Histplot and Kde

Histplot+kde


Pie and Bar chart of Outcome

pie+bar of outcome


Correlation Matrix

correlation_matrix


Boxplot

BOXPLOT


Countplot

countplot


Scatterplot

scatter-plot

Streamlit Web App / UI

A multi-page Web Application consisting of three pages

🔮Predict : Using the pre-built GBC model

Predict-page-light-mode Predict-page-dark-mode

🛠️Build : A custom RFC model by optimizing hyperparameters

Build-page-light-mode Build-page-dark-mode

📊Visualize : A dataset by generating EDA as html using ydata-profiling

Visualize-page-light-more Visualize-page-dark-mode

🚴 Roadmap

  • EDA
  • Model
  • Tkinter Application
  • Custom Tkinter Application
  • Flask Web Application
  • Streamlit Application
  • FastAPI API

$~$

Acknowledgement

  • PIMA Indians Diabetes Database

$~$

Description of EDA_of_the_dataset.ipynb

This notebook file contains the Exploratory Data Analysis of the Diabetes Dataset. It includes the visualization that helps understand the features present in the dataset and their relation with the outcome label.

$~$

🤝 Contributing

Please read our Contributing Guidelines.

📜 License

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

📜 Code of Conduct

Please adhere to our Code of Conduct.

$~$


Open Source Programs

GSSOC Logo VSOC 2024
This project is part of Vinyasa Summer of Code. We warmly welcome contributions from the community to help elevate Diabetes-Prediction-Using-Machine-Learning.

$~$

Line

Tip from us 😇

It always takes time to understand and learn. So, don't worry at all. We know you have got this! 💪

Show some  ❤️  by  🌟  this repository!

Lets build a cool community!

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •