A machine learning web application that predicts whether a patient is diabetic based on medical diagnostic measurements. Built with Python, Scikit-learn, and deployed using Streamlit.
👉 Click here to try the live app!
Deployed on Streamlit Cloud
Diabetes affects over 400 million people worldwide. Early detection is critical for treatment and prevention of complications. This app allows patients and doctors to quickly assess diabetes risk based on simple medical inputs.
| Tool | Purpose |
|---|---|
| Python | Core programming language |
| Pandas & NumPy | Data manipulation and analysis |
| Matplotlib & Seaborn | Data visualization and EDA |
| Scikit-learn | Machine learning model building |
| Streamlit | Web app deployment |
| Pickle | Model saving and loading |
- Source: PIMA Indians Diabetes Dataset (UCI Machine Learning Repository)
- Records: 768 patients
- Features: 8 medical features (Glucose, BMI, Age, Insulin, Blood Pressure, etc.)
- Target: Diabetic (1) or Not Diabetic (0)
- Exploratory Data Analysis (EDA) — Analyzed feature distributions and correlations
- Data Preprocessing — Handled zero values (invalid medical readings), scaled features
- Feature Selection — Identified most important predictors of diabetes
- Model Building — Trained and evaluated:
- Logistic Regression
- Model Evaluation — Accuracy, Confusion Matrix, Classification Report
- Deployment — Saved model as
.pkland built interactive Streamlit app
| Model | Accuracy |
|---|---|
| Logistic Regression | ~78% |
# 1. Clone the repository
git clone https://github.com/nithinreddyp2004/diabetes-prediction.git
# 2. Navigate to the project folder
cd diabetes-prediction
# 3. Install dependencies
pip install -r requirements.txt
# 4. Run the Streamlit app
streamlit run app.pydiabetes-prediction/
│
├── model_training.ipynb # Jupyter notebook with EDA and model training
├── app.py # Streamlit web application
├── model_logistic.pkl # Saved trained model
├── diabetes.csv # Dataset
├── requirements.txt # Python dependencies
└── README.md # Project documentation
- Glucose level is the strongest predictor of diabetes
- Patients with higher BMI are at greater risk
- Age above 45 shows significantly higher diabetes rates
- Insulin levels show high variance — requires careful handling
| Feature | Description |
|---|---|
| Pregnancies | Number of times pregnant |
| Glucose | Plasma glucose concentration |
| Blood Pressure | Diastolic blood pressure (mm Hg) |
| Skin Thickness | Triceps skin fold thickness (mm) |
| Insulin | 2-Hour serum insulin (mu U/ml) |
| BMI | Body mass index |
| Diabetes Pedigree Function | Diabetes likelihood based on family history |
| Age | Age in years |
Nithin Reddy
- GitHub: @nithinreddyp2004
This project is open source and available under the MIT License.