API for the Diabetes Indicator App
- Acess the website here: https://kmads.dev/diabetes-indicator
- Acess the repository here: https://kmads.dev/source-code/diabetes-indicator
- Frontend: Source | Live Deploy
- Backend + Machine Learning: Source
You can acess the API here:
https://api.kmads.dev/diabetes-indicator/<args>
| Endpoint | Method | Description |
|---|---|---|
| / | GET | API status with current model info |
| /health | GET | Health check endpoint |
| /models | GET | List all available trained models |
| /predict | GET | Diabetes prediction with confidence percentage |
The /predict endpoint accepts 17 comma-separated health indicators:
| # | Field | Type | Values |
|---|---|---|---|
| 1 | HighBP | int | 0, 1 |
| 2 | HighChol | int | 0, 1 |
| 3 | CholCheck | int | 0, 1 |
| 4 | BMI | float | 0-275 |
| 5 | Smoker | int | 0, 1 |
| 6 | Stroke | int | 0, 1 |
| 7 | HeartDiseaseorAttack | int | 0, 1 |
| 8 | PhysActivity | int | 0, 1 |
| 9 | Fruits | int | 0, 1 |
| 10 | Veggies | int | 0, 1 |
| 11 | HvyAlcoholConsump | int | 0, 1 |
| 12 | AnyHealthCare | int | 0, 1 |
| 13 | NoDocbcCost | int | 0, 1 |
| 14 | GenHlth | int | 1-5 |
| 15 | DiffWalk | int | 0, 1 |
| 16 | Sex | int | 0, 1 |
| 17 | Age | int | 0-13 (age groups) |
diabetes-indicator-backend
⊢ trained-models/
| ⌞ <.pkl files> (models trained and ready for production)
⊢ machine-learning/
| ⌞ ml.ipynb (python notebook where the models are trained)
⊢ main.py (API made with fastapi and uvicorn)
⊢ requirements.txt (python dependencies)
⊢ vercel.json (vercel deploy config)
⌞ README.md
clientRequest request prediction from thefrontendfrontendgets prediction fromapi/backendchoose the latest model (.pkl) fromtrained-models/trained-models/receives the model (.pkl) frommachine-learning/
Simplified:
- Client -> Frontend <-> Backend ->
<model>.pkl(trainedModels/)
No restrictions of use, just give some credits if you want