Sign inSign up

bhgedigital/ts-model1

By bhgedigital

•Updated almost 8 years ago

Sample predictive time series model with REST API

Image
1

1.1K

bhgedigital/ts-model1 repository overview

⁠ts-model1

Sample Predictive Time Series Model with REST API built in Go

⁠Running the model

	docker run -d --name ts-model1 -p 8080:8080 -p 8088:8088 bhgedigital/ts-model1

⁠Status of the model container

	docker ps -a | grep ts-model1

⁠Model logs

	docker logs -f $(docker ps -a | grep ts-model1 | cut -d ' ' -f 1)

⁠Stopping the model

	docker rm -f $(docker ps -a | grep ts-model1 | cut -d ' ' -f 1)

⁠REST API

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⁠

Tag summary

Content type

Image

Digest

Size

10.4 MB

Last updated

almost 8 years ago

docker pull bhgedigital/ts-model1