Machine Learning Forecast¶
Get the predition results of the deployed machine learning algorithm model.
For information about deploying algorithm models, see Algorithm Model Hosting.
Request Format¶
POST https://{apigw-address}/ml-service/v1.0/forecasts?action=run
Request Parameters (URI)¶
Name | Location (Path/Query) | Mandatory/Optional | Data Type | Description |
---|---|---|---|---|
orgId | Query | Mandatory | String | The organization ID which the user belongs to. How to get orgId >> |
serviceId | Query | Mandatory | String | The service ID that is generated after deploying the algorithm model. |
Request Parameters (Body)¶
Name | Mandatory/Optional | Data Type | Description |
---|---|---|---|
parameters | Mandatory | String | The business parameters for the algorithm model in JSON format. The parameters and values must match with the requirements of the model. |
Response Parameters¶
Name | Data Type | Description |
---|---|---|
data | Struct | The returned prediction results in JSON format. Data type of the results can be basic data types, complex types, and array. |
Samples¶
Request Sample¶
url: https://{apigw-address}/ml-service/v1.0/forecasts?action=run&orgId=yourOrgId&serviceId=f40fbb09-ce20-463f-bb18
method: POST
requestBody:
{
"parameters": {
"ColumnNames": [
"age",
"workclass",
"fnlwgt",
"education",
"education-num",
"marital-status",
"occupation",
"relationship",
"race",
"sex",
"capital-gain",
"capital-loss",
"hours-per-week",
"native-country"
],
"Values": [
[
"0",
"value",
"0",
"value",
"0",
"value",
"value",
"value",
"value",
"value",
"0",
"0",
"0",
"value"
],
[
"0",
"value",
"0",
"value",
"0",
"value",
"value",
"value",
"value",
"value",
"0",
"0",
"0",
"value"
]
]
}
}
Return Sample¶
{
"status": 0,
"msg": "Success",
"data": {
"ColumnNames": [
"Scored Labels",
"Scored Probabilities"
],
"ColumnTypes": [
"String",
"Numeric"
],
"Values": [
[
"value",
"0"
],
[
"value",
"0"
]
]
}
}