| copyright |
|
||
|---|---|---|---|
| lastupdated | 2017-08-09 |
{:new_window: target="_blank"} {:shortdesc: .shortdesc} {:screen: .screen} {:codeblock: .codeblock} {:pre: .pre}
POST http://{PA Bluemix load balancer URL}/pm/v1/score/{contextId}?accesskey={access_key for this bound application}
Use this API call to post the input data to use by the deployed model to generate and return the predictive analytics in the score results.
Request example:
Content-Type: application/json;charset=UTF-8
Parameters:
Path parameters:
contextId: the identifier of the deployed model to use to process this score request
Query Parameters:
accesskey: access_key from env.VCAP_SERVICES
Body: the input data, json string, eg.
{
"tablename":"DRUG1n.sav",
"header":["Age", "Sex", "BP", "Cholesterol", "Na", "K", "Drug"],
"data":[[43.0, "M", "LOW", "NORMAL", 0.526102, 0.027164, "drugY"]]
}
{: codeblock}
Example of a successful response to the previous request:
Content-Type: application/json;charset=UTF-8
Status code: 200
body: the score result, a json array, eg.
[
{
"header":["Age","Sex","BP","Cholesterol","Na""K","Drug","$N-Drug","$NC-Drug"],
"data":[[23.0,"M","NORMAL","NORMAL",0.78452,0.055959,"drugX","drugX",0.9892564426956728]]
}
]
{: codeblock}
Response when scoring request fails:
Content-Type: application/json
Status code: 200
body:
{
"flag":false,
"message":"reason"
}
{: codeblock}