Creates a model based on configurations.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only the common request headers. For more information, see Common request parameters.

Request syntax

POST /v4/openapi/app-groups/[appGroupIdentity]/algorithm/models HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
appGroupIdentity String Path Yes my_app_group_name

The name of the application.

Request body

Parameter

Type

Required

Example

Description

type

String

Yes

"pop"

The type of the algorithm.

name

String

Yes

"my_model"

The name of the model.

industry

String

No

"general"

The industry to which the model applies.

trainTarget

String

No

"click"

The training goal of the model.

behaviorEnabled

Boolean

No

true

Specifies whether to use behavioral data.

behaviorFromGroupName

String

No

The name of the application whose behavioral data source is used.

cron

String

No

The CRON expression for scheduled training.

cronEnabled

Boolean

No

true

Specifies whether to enable scheduled training.

availableThreshold

Float

No

0.8

The threshold that an available model must reach.

filter

String

No

The filter condition for importing data.

fields[]

Object

No

The fields to be used by the model.

If this parameter is left empty, the default fields are used.

fields[].name

String

Yes

The name of the field.

fields[].appFieldType

String

No

The role of the field in the application.

fields[].processType

String

No

The processing type for the field.

For more information, see Model.

Response parameters

Parameter Type Example Description
requestId String 3AA29D02-54F3-8569-F71A-90E1B7BE4E7E

The ID of the request.

result Map 804

The ID of the model.

Examples

Sample requests

POST /v4/openapi/app-groups/my_app/algorithm/models

{
    "type": "suggest",
    "name": "suggestModel",
    "industry": "general",
    "filter": "user_id=1,level=1",
    "fields": [
        {
            "name": "item_title"
        },
        {
            "name": "item_content"
        },
        {
            "name": "item_title_keep",
            "processType": "reserve"
        }
    ],
    "extend": {
        "useHotQuery": true,
        "useHistoryQuery": true
    }
}

Sample success responses

XML format

<requestId>3AA29D02-54F3-8569-F71A-90E1B7BE4E7E</requestId>
<result>
    <id>804</id>
</result>

JSON format

{
    "requestId": "3AA29D02-54F3-8569-F71A-90E1B7BE4E7E",
    "result": {
        "id": 804
    }
}

Error codes

For a list of error codes, visit the API Error Center.