This service is provided as-is. No data are stored during any operation of the service. User is responsible to transform input to match this of the service.
Service is online in the following ip: http://147.102.40.97:8000
API endpoints
There are currently 2 endpoints supported by the service:
- POST: /api/v1/predict (returns json in the format {"prediction":[0]} και code 200)
- GET: /api/v1/health (returns json in the format {"status": "Healthy"} and code 200 if the service is up and running).
/api/v1/predict endpoint requires as an input a 5 minute window sampled at 30 seconds, therefore a list of 10 elements with the following variables are expected.
SpO2 (float): Oxygen Saturation, obtained from sensors.
HR (float): Heart Rate, obtained from sensors.
HRV (float): Heart Rate Variability, obtained by using RMSSD algorithm.
activity (float): activity counts, calculated as in MESA dataset.
As a result, the service will yield an integer in the range [0, 2],
where 0: Wake, 1: NREM, 2: REM.
Demonstration
A minimum example using “bash” to operate service can be previewed below
curl --request POST \
--url http://147.102.40.97:8000/api/v1/predict \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"SpO2": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
"activity": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
"HRV": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
"HR": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]}'
Yields: [{"prediction":[0]},200], which means code 200 (service finished job successfully) and predicted probably “Wake”.