Giter Site home page Giter Site logo

diabetes_prediction_webapplication_streamlit's Introduction

Women Diabetes Prediction Web App

This project implements a Support Vector Machine (SVM) model to predict diabetes using the Pima Indians Diabetes Dataset. It's deployed as a Streamlit web app allowing users to interact and get predictions directly.

Getting Started

This project requires the following Python libraries:

  • pandas (used for data manipulation in the original script, not required for the web app)
  • numpy
  • scikit-learn (used for the loaded model, not required for running the web app)
  • pickle (used to load the saved model)
  • streamlit

You can install them using pip:

pip install numpy scikit-learn pickle streamlit

Make sure you have a saved model file named 'trained_model.sav' in the 'C:/DeployML/' directory. This file is generated by the original Python script (not included here).

Running the Web App

  1. Clone this repository.
  2. Open a terminal or command prompt and navigate to the project directory.
  3. Run the script using Python:
streamlit run app.py

This will launch the web app in your web browser, typically at http://localhost:8501.

Using the Web App

The web app provides a user-friendly interface for diabetes prediction. Enter the following details:

  • Number of pregnancies
  • Glucose level
  • Blood pressure level
  • Skin-thickness
  • Insulin level
  • BMI
  • Diabetes Pedigree Function
  • Age

Click the "Click for Diabetes Test Result" button to receive a prediction ("This person is non-diabetic" or "This person is diabetic").

Project Breakdown

The original Python script for model building and evaluation is not included here. This README focuses on the Streamlit web app (app.py) which performs the following:

  1. Loads the saved model: The pickle library is used to load the pre-trained SVM model from the 'trained_model.sav' file.
  2. Defines a prediction function (diabetes_pred): This function takes user input as a list, converts it to a NumPy array, reshapes it for prediction, and uses the loaded model to predict the class (diabetic or non-diabetic).
  3. Main function (main):
    • Sets the web app title ("Women Diabetes Prediction Web App").
    • Creates text input fields for each user input parameter.
    • Defines a button to trigger the prediction.
    • When the button is clicked, it calls the diabetes_pred function with user input and displays the prediction result as a success message.

Additional Notes

  • This web app utilizes a pre-trained model. The model building and evaluation process is not included.
  • Ensure you have the 'trained_model.sav' file in the specified location.
  • This is a basic implementation, and exploring different SVM kernels or feature engineering techniques might improve performance.

diabetes_prediction_webapplication_streamlit's People

Contributors

arghyadeep1009 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.