Example ml-fastapi application for https://www.healthuniverse.com/ hackathon.
Diabet Estimator
source of dataset :https://www.kaggle.com/datasets/alexteboul/diabetes-health-indicators-dataset
#if you want to run only jupyter notebook you can reach from this link : https://www.kaggle.com/code/sirmax/diabet-indicator/notebook
type in the command line :python3 main.py
open the tests folder and type in the command line :pytest
If you run software open the browser and click this link:http://0.0.0.0:8000
If you run software open the browser and click this link:http://0.0.0.0:8000/docs
import requests
import json
url = "http://0.0.0.0:8000/predict"
payload = json.dumps({
"features": [
1,
2,
21,
1,
3
]
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)