This repository contains a machine learning model for predicting whether a person is diabetic or not. The model is integrated into a web application using Flask, allowing users to interact with it through a user-friendly interface.
The machine learning model is trained on a dataset containing relevant features such as age, BMI, blood pressure, and glucose levels. It leverages with framework like scikit-learn to achieve accurate predictions. The model is then integrated into a Flask web application, providing a seamless and accessible way for users to make predictions.
The dataset is originally from the National Institute of Diabetes and Digestive and Kidney Diseases. The objective of the dataset is to diagnostically predict whether or not a patient has diabetes, based on certain diagnostic measurements included in the dataset.
Diabetes Prediction Model: A trained machine learning model that takes input parameters and predicts the likelihood of a person being diabetic.
Flask Web Application: A user interface created with Flask that allows users to input their information and receive predictions in real-time.
The dataset consists of several features like number of pregnancies, BMI, Age, Blood Pressure, Insulin level, Glucose level, Diabetes Pedigree Function and the target variable the outcome i.e. is the person suffering from diabetes (1) or not (0).
- Pregnancies: Number of times pregnant
- Glucose: Plasma glucose concentration a 2 hours in an oral glucose tolerance test
- Blood Pressure: Diastolic blood pressure (mm Hg)
- SkinThickness: Triceps skinfold thickness (mm)
- Insulin: 2-Hour serum insulin (mu U/ml)
- BMI: Body mass index (weight in kg/(height in m)²)
- DiabetesPedigreeFunction: It provided some data on diabetes mellitus history in relatives and the genetic relationship of those relatives to the patient.
- Age: Age (years)
- Outcome: Class variable (0 or 1) 268 of 768 is 1, the others are 0
You Can Download the Dataset by clicking the link : Dataset Link.
- Create a Dataframe from the dataset
- Perform Exploratory Data Analysis
- Consider the data into features and Target(splice into input and output)
- Split data into training and testing
- Perform preprocessing (if required)
- Apply ML algorithm (using Sklearn library) for the above training data
- Predict for Testing Data
- Evaluate the test result by considering Accuracy Score, Confusion Matrix
- Model Serialization into a pickle file
Diabetes_Prediction(root)
|____templates
|___index.html
|___result.html
|____static
|____css
|_____js
|_____images
|____app.py
|_____Diabetes.pkl
|____diabetes.csv
|____diabetes.ipynb
To run the web application locally, follow these steps:
1. Clone the Repository:
git clone https://github.com/MLakshmipraharsha07/Diabetes_Prediction.git
cd Diabetes_Prediction
OR
Download the zip file and extract the files in your local system.
2. Install Dependencies:
pip install -r requirements.txt
3. Pickle File for model serialization:
Download the serialized model file (pickle file) and place it in the Diabetes_Prediction/ directory.
4. Run the Web Application:
- Run the Flask Application
python app.py - Visit http://127.0.0.1:5000/ in your web browser. or You can just click the live server link that is generated in the terminal when the app.py file is executed.
- Open the web application in your browser.
- Enter the required information (e.g., age, BMI, blood pressure, glucose levels).
- Click the "Predict" button.
- The application will display the predicted result, indicating whether the person is diabetic or not.