Built-in Predictive Analytics Mode

Input

This is a built-in input and output mode for predictive analytics. The models using this mode are identified as predictive analytics models. The prediction request path is /, the request protocol is HTTP, the request method is POST, and Content-Type is application/json. The request body is in JSON format. For details about the JSON fields, see Table 1. Before selecting this mode, ensure that your model can process the input data in JSON Schema format.

Table 1 JSON field description

Field

Type

Description

data

Data structure

Inference data. For details, see Table 2.

Table 2 Data description

Field

Type

Description

req_data

ReqData array

List of inference data

ReqData is of the Object type and indicates the inference data. The data structure is determined by the application scenario. For models using this mode, the preprocessing logic in the custom model inference code should be able to correctly process the data inputted in the format defined by the mode.

The JSON Schema of a prediction request is as follows:

{
	"type": "object",
	"properties": {
		"data": {
			"type": "object",
			"properties": {
				"req_data": {
					"items": [{
						"type": "object",
						"properties": {}
					}],
					"type": "array"
				}
			}
		}
	}
}

Output

The inference result is returned in JSON format. For details about the JSON fields, see Table 3.

Table 3 JSON field description

Field

Type

Description

data

Data structure

Inference data. For details, see Table 4.

Table 4 Data description

Field

Type

Description

resp_data

RespData array

List of prediction results

Similar to ReqData, RespData is also of the Object type and indicates the prediction result. Its structure is determined by the application scenario. For models using this mode, the postprocessing logic in the custom model inference code should be able to correctly output data in the format defined by the mode.

The JSON Schema of a prediction result is as follows:

{
	"type": "object",
	"properties": {
		"data": {
			"type": "object",
			"properties": {
				"resp_data": {
					"type": "array",
					"items": [{
						"type": "object",
						"properties": {}
					}]
				}
			}
		}
	}
}

Sample Request

In this mode, input the data to be predicted in JSON format. The prediction result is returned in JSON format. The following are examples: