How osamanayfeh/diabetes-prediction-xgboost-ann works
This repository is a diabetes-risk ML application comparing XGBoost with a PyTorch feedforward network. Its main workflow downloads patient data, creates leak-free train/validation/test splits, trains both models, and evaluates them on the held-out test set. A separate prediction command accepts one patient’s measurements and returns both models’ risk assessments. Training and evaluation modules are shown directly; capabilities described only in the README are represented with documented links where their implementation is not shown.
Main entry points: evaluate.py Compare models · train_ann.py Train ANN · data_preprocessing.py Split and preprocess · train_xgboost.py Train XGBoost
Components 13
Data preparation
- Split and preprocess
src/data_preprocessing.py
Model training
- Train XGBoost
src/train_xgboost.py - Train ANN
src/train_ann.py - ANN architecture
src/train_ann.py
Prediction and evaluation
- Patient prediction
src/predict.py - Compare models
src/evaluate.py
Data and artifacts
- Raw and split data
data - Models and preprocessors
models - Evaluation results
results - Diagnostic plots
images
Shared utilities
- Paths and logging
src/utils.py
Other components
- Analyst or clinician
- Pima dataset source
Connections 27
- Analyst or clinician → Split and preprocess: starts workflow
README.md - Pima dataset source → Split and preprocess: provides data
src/data_preprocessing.py - Split and preprocess → Raw and split data: writes splits
src/data_preprocessing.py - Split and preprocess → Models and preprocessors: writes scaler and medians
src/data_preprocessing.py - Analyst or clinician → Train XGBoost: starts training
README.md - Raw and split data → Train XGBoost: reads train and validation
src/train_xgboost.py - Train XGBoost → Models and preprocessors: saves model
src/train_xgboost.py - Train XGBoost → Diagnostic plots: saves feature plot
src/train_xgboost.py - Analyst or clinician → Train ANN: starts training
README.md - Raw and split data → Train ANN: reads training splits
src/train_ann.py - Train ANN → ANN architecture: instantiates
src/train_ann.py - Train ANN → Models and preprocessors: saves checkpoint
src/train_ann.py - Train ANN → Diagnostic plots: saves loss curve
src/train_ann.py - Analyst or clinician → Compare models: starts evaluation
README.md - Raw and split data → Compare models: reads test split
src/evaluate.py - Models and preprocessors → Compare models: loads trained models
src/evaluate.py - Compare models → ANN architecture: constructs ANN
src/evaluate.py - Compare models → Evaluation results: writes metrics
src/evaluate.py - Compare models → Diagnostic plots: writes ROC and confusion plots
src/evaluate.py - Analyst or clinician → Patient prediction: provides patient measurements
src/predict.py - Models and preprocessors → Patient prediction: loads models and preprocessing
src/predict.py - Patient prediction → ANN architecture: instantiates ANN
src/predict.py - Split and preprocess → Paths and logging: uses paths and seeding
src/data_preprocessing.py - Train XGBoost → Paths and logging: uses paths and seeding
src/train_xgboost.py - Train ANN → Paths and logging: uses paths and seeding
src/train_ann.py - Compare models → Paths and logging: uses paths and logging
src/evaluate.py - Patient prediction → Paths and logging: uses paths and logging
src/predict.py