Sample predictive time series model with REST API
1.1K
Sample Predictive Time Series Model with REST API built in Go
docker run -d --name ts-model1 -p 8080:8080 -p 8088:8088 bhgedigital/ts-model1
docker ps -a | grep ts-model1
docker logs -f $(docker ps -a | grep ts-model1 | cut -d ' ' -f 1)
docker rm -f $(docker ps -a | grep ts-model1 | cut -d ' ' -f 1)
Once the container status shows "Up", the REST API will be served on http://localhost:8088/bhge/model. Swagger documentation will be available on: http://petstore.swagger.io/?url=http%3A%2F%2Flocalhost%3A8080%2Fswagger.json#/model/predict The Swagger UI can be used to generate curl commands to test the model. A sample curl command is shown below:
curl -X POST "http://localhost:8088/bhge/model" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"X1\": [ 1, 1.5, 2 ], \"X2\": [ 2.1, 2.2, 2.3 ], \"X3\": [ 3, 4.5, 5.66 ]}"
The model responds to this command with the following output:
{"Y":[4.273999999999994,44.62199999999998,88.58040000000003]}
Requests to the REST API can also be submitted using tools like Postman
Content type
Image
Digest
Size
10.4 MB
Last updated
almost 8 years ago
docker pull bhgedigital/ts-model1