How guptamanvi1106/-diabetes-prediction-system works
This is a Flask-based diabetes-risk prediction application. Its main workflow takes patient measurements from a browser or API client, validates them, runs single or CSV-batch predictions, and returns labels with confidence scores; batch results can also be downloaded as CSV. Model training is a separate lifecycle that reads the PIMA dataset and saves the SVM and scaler used at runtime. README-described browser capabilities are represented at the existing index.html path, but its implementation was not sampled, so the UI-to-API relationship is documented rather than source-verified.
Main entry points: app.py Flask endpoints · utils.py Model loading · train_model.py Model training · index.html Prediction interface
Components 15
Client experience
- Prediction interface
index.html
Prediction API
- Flask endpoints
backend/app.py - Input validation
backend/utils.py - Single prediction
backend/utils.py - Batch prediction
backend/utils.py - Prediction results
backend/app.py
Model lifecycle
- Model training
backend/train_model.py - PIMA dataset
backend/dataset/diabetes.csv - SVM model
backend/model.pkl - StandardScaler
backend/scaler.pkl
Runtime support
- Model loading
backend/utils.py - Request logging
backend/app.py - Logging setup
backend/utils.py
Other components
- Patient / user
- API client
Connections 16
- Patient / user → Prediction interface: enters measurements
README.md - Prediction interface → Flask endpoints: sends requests
README.md - API client → Flask endpoints: calls endpoints
README.md - Flask endpoints → Input validation: validates input
backend/app.py - Flask endpoints → Single prediction: requests prediction
backend/app.py - Flask endpoints → Batch prediction: requests batch prediction
backend/app.py - Flask endpoints → Prediction results: returns results
backend/app.py - Model training → PIMA dataset: loads data
backend/train_model.py - Model training → SVM model: saves model
backend/train_model.py - Model training → StandardScaler: saves scaler
backend/train_model.py - Model loading → SVM model: loads model
backend/utils.py - Model loading → StandardScaler: loads scaler
backend/utils.py - Single prediction → Model loading: gets model and scaler
backend/utils.py - Batch prediction → Model loading: gets model and scaler
backend/utils.py - Flask endpoints → Request logging: logs requests
backend/app.py - Request logging → Logging setup: uses logger
backend/app.py