How gyanu-2000/diabetes-prediction works
DiaPredict is a Flask diabetes-risk prediction app with a browser UI, a validated prediction endpoint, and an optional Anthropic health-insight proxy. The core workflow accepts four patient measurements, applies a LogisticRegression model trained from the CSV dataset (or loaded from a saved artifact), and returns a classification and probability. The graph follows the documented routes and inspected Python code; the template’s internal behavior was not sampled, so no frontend-to-endpoint call is asserted.
Main entry points: app.py Prediction endpoint · model.py Model loader · diabetes_predictor.html Predictor page · diabetes.csv Diabetes dataset
Components 12
Web interface
- Flask application
app.py - Predictor page
templates/diabetes_predictor.html - Insight proxy
app.py
Risk prediction
- Prediction endpoint
app.py - Input validation
app.py - Risk prediction
model.py
Model lifecycle
- Model loader
model.py - Model training
model.py - Diabetes dataset
diabetes.csv - Saved model artifact
model.py
Other components
- Browser user
- Anthropic API
Connections 13
- Browser user → Flask application: requests pages
- Flask application → Predictor page: renders
- Browser user → Prediction endpoint: submits measurements
- Prediction endpoint → Input validation: validates
- Prediction endpoint → Risk prediction: requests prediction
- Risk prediction → Prediction endpoint: returns result
- Flask application → Model loader: loads at startup
- Model loader → Saved model artifact: loads if present
- Model loader → Model training: trains if absent
- Model training → Diabetes dataset: reads
- Model training → Saved model artifact: saves model
- Browser user → Insight proxy: requests insights
- Insight proxy → Anthropic API: forwards request