Turning routine clinical measurements into early, explainable risk signals.
Diabetes AI Diagnostics is a complete, production-minded machine learning pipeline for early detection of diabetes from clinical data. Built on the well-known Pima Indians Diabetes Dataset (included in this repository — no external download required), this project goes beyond a single model — it engineers 15 new predictive features, systematically benchmarks 12 different algorithms, and delivers a tuned XGBoost classifier reaching 0.92 ROC-AUC.
Every prediction is paired with an explanation: using SHAP, the system doesn't just flag risk — it shows why, offering interpretability that matters in a clinical context. Hyperparameters are tuned automatically with Optuna, and the codebase is organized into clean, modular, tested components suitable for extension into a real deployment pipeline.
| 🧬 Advanced Feature Engineering | 15 engineered features, including interaction terms and clinically-informed ratios |
| ⚔️ Multi-Model Benchmarking | 12 algorithms compared head-to-head — from logistic regression to gradient boosting and deep neural networks |
| 🎯 Automated Hyperparameter Tuning | Optuna-driven search for optimal model configuration |
| 🔍 Explainable Predictions | SHAP values reveal the reasoning behind every individual risk assessment |
| 🧱 Modular, Production-Ready Code | Clear separation of data, feature, model, and visualization layers |
| ✅ Automated Testing & CI | Unit tests + GitHub Actions run on every push |
| 🐳 Containerized | One-command reproducible environment via Docker |
| Model | Accuracy | Precision | Recall | F1 Score | ROC-AUC |
|---|---|---|---|---|---|
| XGBoost (Tuned) | 0.88 | 0.86 | 0.85 | 0.85 | 0.92 |
| Random Forest | 0.85 | 0.83 | 0.82 | 0.82 | 0.89 |
| Neural Network (TensorFlow) | 0.84 | 0.84 | 0.81 | 0.82 | 0.88 |
The tuned XGBoost model consistently outperforms alternative approaches across every metric, making it the pipeline's production candidate.
- Python 3.10 or later
- Git
git clone https://github.com/jjagent13/diabetes-ai-diagnostics.git
cd diabetes-ai-diagnostics
pip install -r requirements.txtjupyter notebook notebooks/MyProject.ipynbpython -m src.models.train_modelThis runs the reusable pipeline in src/ (data loading → feature engineering → training → evaluation) and saves the fitted model to models/diabetes_model.pkl.
docker build -t diabetes-ai-diagnostics .
docker run -p 8888:8888 diabetes-ai-diagnosticsThen open the Jupyter URL printed in the terminal.
pip install -r requirements-dev.txt
pytest tests/ --verboseTests run automatically on every push via GitHub Actions (see badge above).
- Python — core language
- Scikit-learn — classical ML models
- XGBoost / CatBoost — gradient boosting
- TensorFlow — deep neural network
- SHAP — model interpretability
- Optuna — hyperparameter optimization
- Docker — reproducible environment
- GitHub Actions — continuous integration
diabetes-ai-diagnostics/
├── .github/workflows/ # CI pipeline (lint, test, Docker build)
│ └── ci.yml
├── configs/ # Project configuration
│ └── config.yaml
├── data/ # Dataset (Pima Indians Diabetes, included)
│ └── diabetes.csv
├── models/ # Saved trained models (generated, gitignored)
├── notebooks/ # Exploratory & end-to-end analysis
│ └── MyProject.ipynb
├── src/ # Reusable, tested source code
│ ├── data/ # Loading & cleaning
│ ├── features/ # Feature engineering
│ ├── models/ # Training & evaluation
│ └── visualization/ # Plotting utilities
├── tests/ # Unit tests (pytest)
├── Dockerfile
├── .dockerignore
├── .gitignore
├── LICENSE
├── README.md
├── requirements.txt
└── requirements-dev.txt
This project is released under the MIT License. See LICENSE for details.
Sajjad Sormalipour GitHub
- The Pima Indians Diabetes Dataset
- The open-source Scikit-learn and XGBoost communities
If this project helped you, consider giving it a ⭐ on GitHub.