personalised diabetes prediction along with a Q & A Chatbot
finalapp.py
: The main script for running the Streamlit web app.requirements.txt
: Lists all the dependencies required for the project.wowmodel2.pkl
: The pre-trained machine learning model.diabetes_prediction_dataset.csv
: The dataset used for predictions and visualizations.
- Conducted one-hot encoding categorical features
- Implemented
Random Forest
withGridSearchCV
for Hyperparameter Tuning
- Selected best parameters after cross-validation.
- Evaluated model performance on the test set.
- Achieved high accuracy
0.94
on the test set.
-
User Authentication
Users can log in using their name. The session state is used to manage user accounts and their prediction history
-
Data Input
The sidebar allows users to input various health indicators such as
gender
,age
,hypertension
,heart disease
,smoking history
,height
,weight
,HbA1c level
, andblood glucose level
.BMI is calculated automatically based on the height and weight inputs.
-
Prediction
The
predict_button
triggers the prediction function which uses the pre-trained model to predict the likelihood of diabetes. The prediction result is displayed to the user.The pre-trained achieving an accuracy of
94%
on a100000
large dataset was loaded as a.pkl
file into thestreamlit
code. -
Visualisation
Seaborn
andMatplotlib
enables the users to examine the relationship between the features. Multiple graphs integrated to provide a comprehensive overview of theinput data
and thediabetes_prediction_dataset.csv
.If diabetic the plot on the graph is a unique circle with a shade of
red
, else the circle plotted is dark shade ofblue
. -
Suggestions
Personalised lifestyle and dietary suggestions, including helpful resources of hospitals in India are provided by the integrtaion of
gemini-1.5-flash
LLM model.Sutable
safety_settings
andtemperature
was configured along with the nucleus sampling of thetop_k
andtop_p
temperatureKept maximum output of
4096
tokens at a time for the assistance. -
Q & A Chatbot
The website hosts a Q & A Chatbot to answer queries arising by patients. The history of queries entered by the user are saved and displayed in the end. The chatbot leverages the use of
gemini-1.5-flash
LLM Model.