https://github.com/malharinamdar/diabetescare-ai
diabetes prediction system
https://github.com/malharinamdar/diabetescare-ai
gemini-flash hyperparameter-tuning random-forest streamlit-webapp
Last synced: 6 months ago
JSON representation
diabetes prediction system
- Host: GitHub
- URL: https://github.com/malharinamdar/diabetescare-ai
- Owner: malharinamdar
- Created: 2024-07-12T16:07:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-11T19:02:30.000Z (10 months ago)
- Last Synced: 2025-02-10T15:24:18.698Z (8 months ago)
- Topics: gemini-flash, hyperparameter-tuning, random-forest, streamlit-webapp
- Language: Jupyter Notebook
- Homepage: https://diabetescare-ai-tech.streamlit.app/
- Size: 7.27 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DiabetesCare-AI
personalised diabetes prediction along with a Q & A Chatbot
## File Structure- `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.
### Preprocessing, Model Building and Hyperparameter Tuning
- Conducted one-hot encoding categorical features
- Implemented `Random Forest` with `GridSearchCV` for Hyperparameter Tuning
### Results:
- Selected best parameters after cross-validation.
- Evaluated model performance on the test set.
- Achieved high accuracy `0.94` on the test set.
## Web App Components
1. **User Authentication**
Users can log in using their name.
The session state is used to manage user accounts and their prediction history
2. **Data Input**
The sidebar allows users to input various health indicators such as `gender`, `age`,
`hypertension`, `heart disease`, `smoking history`, `height`, `weight`, `HbA1c level`, and `blood glucose level`.
BMI is calculated automatically based on the height and weight inputs.
3. **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 a `100000` large dataset was loaded as a `.pkl` file
into the `streamlit` code.
4. **Visualisation**
`Seaborn` and `Matplotlib` enables the users to examine the relationship between the features.
Multiple graphs integrated to provide a comprehensive overview of the `input data` and the `diabetes_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 of `blue`.
5. **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` and `temperature` was configured along with the **nucleus sampling** of the
`top_k` and `top_p` temperatureKept maximum output of `4096` tokens at a time for the assistance.
6. **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.