A machine learning-based web application for predicting diabetes risk using Streamlit. This application provides an interactive interface for users to input health parameters and receive instant diabetes risk predictions with visual feedback.
- User Authentication: Secure login system with session management
- Diabetes Prediction: ML model predicts diabetes risk based on health parameters
- Visual Analytics: Probability visualization with bar charts
- Health Recommendations: Personalized precautions for diabetes positive cases
- User-Friendly Interface: Clean and intuitive design with responsive layout
- Frontend: Streamlit
- Backend: Python
- Machine Learning: Scikit-learn (Random Forest Classifier)
- Data Processing: Pandas, NumPy
- Visualization: Matplotlib
- Deployment: Streamlit Cloud / Heroku / AWS
| Parameter | Range | Description |
|---|---|---|
| Pregnancies | 0-20 | Number of pregnancies |
| Glucose Level | 0-200 | Plasma glucose concentration |
| Blood Pressure | 0-140 | Diastolic blood pressure |
| Skin Thickness | 0-100 | Triceps skin fold thickness |
| Insulin Level | 0-900 | 2-Hour serum insulin |
| BMI | 0-70 | Body Mass Index |
| Diabetes Pedigree Function | 0-2.5 | Diabetes family history score |
| Age | 0-120 | Age in years |
- Python 3.8 or higher
- pip (Python package manager)
git clone https://github.com/yourusername/diabetes-prediction-app.git
cd diabetes-prediction-app
Step 2: Install Dependencies
bash
pip install -r requirements.txt
Step 3: Run the Application
bash
streamlit run app.py
Step 4: Access the App
Open your browser and navigate to:
text
http://localhost:8501
πΈ Screenshots
Login Page
https://screenshots/login.png
Prediction Form
https://screenshots/form.png
Result Page
https://screenshots/result.png
π― How It Works
Login: Users authenticate with their credentials
Input: Enter patient health parameters
Predict: Click the predict button
Results: View prediction results with probability visualization
Recommendations: Get health recommendations if diabetes positive
π Project Structure
text
diabetes-prediction-app/
βββ app.py # Main application
βββ diabetes_model.pkl # Trained ML model
βββ requirements.txt # Dependencies
βββ README.md # Documentation
βββ screenshots/ # Screenshots
π€ Machine Learning Model
Algorithm: Random Forest Classifier
Dataset: Pima Indians Diabetes Database
Features: 8 medical parameters
Performance: 78% accuracy on test data
π§ Configuration
Model File
Ensure diabetes_model.pkl is in the root directory. The model should be trained with the same features as the input form.
Customization
Modify MODEL_PATH variable in app.py to change model location
Adjust slider ranges in the form as needed
Customize sidebar content in the app
π¨βπ» Author
Habib Zahid
Email: habibzahid203@gmail.com
Service: Machine Learning & AI Solutions
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
Streamlit for the amazing framework
Scikit-learn community
π€ Contributing
Fork the repository
Create your feature branch (git checkout -b feature/AmazingFeature)
Commit your changes (git commit -m 'Add some AmazingFeature')
Push to the branch (git push origin feature/AmazingFeature)
Open a Pull Request
π Contact
For any queries or suggestions, please reach out to:
Email: habibzahid203@gmail.com
GitHub:
Made with β€οΈ by Habib Zahid