In [ ]:
%%bash
pio init-model \
--model-server-url http://prediction-pmml.community.pipeline.io/ \
--model-type pmml \
--model-namespace default \
--model-name pmml_balancescale \
--model-version v1 \
--model-path .
In [ ]:
%%bash
pio predict \
--model-test-request-path ./data/test_request.json
In [ ]:
%%bash
pio predict_many \
--model-test-request-path ./data/test_request.json \
--num-iterations 5
In [ ]:
import requests
model_type = 'scikit'
model_namespace = 'default'
model_name = 'scikit_decisiontree'
model_version = 'v1'
deploy_url = 'http://prediction-%s.community.pipeline.io/api/v1/model/predict/%s/%s/%s/%s' % (model_type, model_type, model_namespace, model_name, model_version)
with open('./data/test_request.json', 'rb') as fh:
model_input_binary = fh.read()
response = requests.post(url=deploy_url,
data=model_input_binary,
timeout=30)
print("Success! %s" % response.text)