https://github.com/sgudkov/homework-20250414
https://github.com/sgudkov/homework-20250414
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sgudkov/homework-20250414
- Owner: Sgudkov
- Created: 2025-04-19T08:07:17.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2025-04-27T18:05:46.000Z (about 2 months ago)
- Last Synced: 2025-04-27T19:20:59.412Z (about 2 months ago)
- Language: Python
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Diabetes Prediction API
=========================# Overview
This API uses a pre-trained ONNX model to predict the likelihood of diabetes based on user input.## API Endpoint
POST /
Predict diabetes likelihood based on user input### Request Body
Fields
* Pregnancies: int (>= 0)
* Glucose: int (>= 0)
* BMI: float (>= 0)
* Age: int (>= 0)
### Response
Fields
* description: string (description of the prediction)
* prediction: string (prediction result: 0 = no diabetes, 1 = diabetes)
#### Example Request
```json
{
"Pregnancies": 1,
"Glucose": 120,
"BMI": 25.5,
"Age": 30
}
```
#### Example Response
```json
{
"description": "Предсказание (0=нет диабета, 1=есть)",
"prediction": "1"
}
```
##### Running the API
```bash
uvicorn main:app --host 127.0.0.1 --port 8005 --reload
```
This will start the API server on http://127.0.0.1:8005. You can use a tool like curl to test the API.