👉 Deployed App:
https://diabetes-prediction-system-amwusbsaqrcspfgv6zskka.streamlit.app
The Diabetes Risk Prediction System is an end-to-end Machine Learning application that predicts the likelihood of diabetes using patient medical attributes.
This project demonstrates:
- Data preprocessing & cleaning
- Feature scaling
- Model comparison
- Hyperparameter tuning
- Model evaluation (ROC, AUC, Confusion Matrix)
- Model deployment using Streamlit Cloud
This is a production-style ML workflow, not just a notebook experiment.
- Pima Indians Diabetes Dataset
- 768 samples
- 8 medical predictor features
- Binary classification:
0→ No Diabetes1→ Diabetes
| Model | Accuracy | ROC-AUC |
|---|---|---|
| Logistic Regression | 71% | 0.66 |
| Random Forest (Tuned) | 75% | 0.74 |
Random Forest was selected as the final deployed model after hyperparameter tuning.
- Data Cleaning (zero-value replacement with median)
- Feature Scaling using StandardScaler
- Train-Test Split
- Baseline Model: Logistic Regression
- Random Forest with:
class_weight='balanced'- GridSearchCV for tuning
- Cross-validation
- Model Evaluation:
- Accuracy
- Precision
- Recall
- F1-score
- ROC-AUC
- Model Saving using
joblib - Deployment using Streamlit Cloud
Final Random Forest Performance:
- Accuracy: 74.6%
- ROC-AUC: 0.745
- Balanced performance on imbalanced dataset
- Confusion Matrix analysis
- False Positive & False Negative evaluation
The deployed application also includes:
- ROC Curve visualization
- Feature Importance chart
- Probability confidence scores
- Interactive patient input form
- Model selection (Logistic Regression / Random Forest)
- Risk prediction output (Low / High Risk)
- Confidence probability display
- ROC Curve visualization
- Feature importance chart
- Medical disclaimer
- Clean production UI (Dark theme)
- Python
- Pandas
- NumPy
- Scikit-learn
- Matplotlib
- Seaborn
- Joblib
- Streamlit
- Git & GitHub
- Streamlit Cloud
Diabetes-Prediction-System/ │ ├── Data/ │ └── pima-indians-diabetes.csv │ ├── app.py ├── Train_Model.py ├── diabetes_model.joblib ├── logistic_model.joblib ├── scaler.joblib ├── requirements.txt └── README.md
⚠ Medical Disclaimer
This application is for educational purposes only and should not be considered a medical diagnosis. Always consult a healthcare professional.
🎯 Key Learning Outcomes
Handling imbalanced datasets
Hyperparameter tuning using GridSearchCV
Evaluating ML models beyond accuracy
Saving & loading production models
Deploying ML applications to the cloud
Building interactive ML dashboards
👨💻 Author
Rakhal Krishna AI & Data Science Student
GitHub: https://github.com/Rakhal06
git clone https://github.com/Rakhal06/Diabetes-Prediction-System.git
cd Diabetes-Prediction-System
python -m venv venv
venv\Scripts\activate # Windows
pip install -r requirements.txt
streamlit run app.py