The Model object represents a machine learning model attached to an OpenSearch application. Models drive ranking and recommendation features—such as popularity scoring, category prediction, and drop-down suggestions—by training on behavioral data collected from your application.
Example
{
"id": 113023,
"groupId": "100297752",
"groupName": "appGroupName",
"type": "pop",
"name": "pop_1212",
"trainTarget": "ctr",
"cron": "15 0 */2 * *",
"cronEnabled": true,
"behaviorEnabled": true,
"behaviorFromGroupName": "DemoModelName",
"lastTrainingTime": 1543233439000,
"auc": 0.85,
"status": "train_success",
"progress": 69,
"isAlreadyDeployed": true,
"industry": "general",
"filter": "user_id=1,level=1",
"fields": [
{
"name": "item_title",
"appFieldType": "title"
},
{
"name": "item_content"
},
{
"name": "item_title_keep",
"processType": "reserve"
}
],
"extend": {
"useHotQuery": true,
"useHistoryQuery": true
}
}Structure
Configurable fields
These fields can be set when creating or updating a model.
| Field | Type | Description |
|---|---|---|
name | String | The name of the model. Must match the regular expression /^(?!ops_)[a-zA-Z]\w{0,29}$/. |
type | String | The model type. Valid values: pop (popularity model), cp (category prediction model), hot (top search model), hint (hint model), suggest (drop-down suggestions model). |
industry | String | The industry the model applies to. Valid values: general, ecommerce, content. |
trainTarget | String | The training goal. Valid values: click, buy, cart, collect, like, comment, share, subscribe, gift, download, read, tip. |
behaviorEnabled | Boolean | Specifies whether to use behavioral data for training. Default value: true. Not all model types support behavioral data. |
behaviorFromGroupName | String | The name of the application whose behavioral data is used. Defaults to the current application. |
cron | String | The cron expression that schedules training runs. For cron syntax, see the Linux Crontab documentation. |
cronEnabled | Boolean | Specifies whether scheduled training is enabled. Default value: true. |
availableThreshold | Float | The threshold when the model is qualified. Valid values: 0 to 1. |
filter | String | A filter expression applied during data import. Supported operators: <, >, =, !=, >=, <=. Separate multiple conditions with commas. |
fields[] | Object | The application fields the model uses for training. |
fields[].name | String | The name of the application field. |
fields[].appFieldType | String | The role of the field in the application. Valid values: pk (primary key), cate_id (category ID), title (title), cate_name (category name), normal (regular field). |
fields[].processType | String | The processing type for the field. Valid values: reserve, normal. |
extend | Object | Extended configuration for the model. |
extend.useHotQuery | Boolean | Specifies whether to use hot query-supported models. We recommend that you use the models. |
extend.useHistoryQuery | Boolean | Specifies whether to use historical query-supported models. We recommend that you use the models. |
Read-only fields
These fields are set by the system and cannot be modified directly.
| Field | Type | Description |
|---|---|---|
id | Integer | The ID of the model. |
groupId | String | The ID of the application the model belongs to. |
groupName | String | The name of the application the model belongs to. |
lastTrainingTime | Integer | The most recent time when the training was complete. |
lastModifyTime | Integer | The most recent time when the model was modified. |
auc | Float | The area under curve (AUC) value of the model. |
status | String | The current status of the model. See Model status values. |
progress | Integer | The completion percentage of the current training task. |
isAlreadyDeployed | Boolean | Specifies whether the model has been deployed, or whether one or more models with the same configuration are already available. |
Model status values
| Status | Description |
|---|---|
train_init | The model is to be trained. |
train_pending | The model is being trained. |
validate_failed | An exception related with the data occurred. |
train_failed | The training failed. |
train_bad_model | The training succeeded but the model failed the training. |
train_success | The training succeeded and the model passed the training. |
该文章对您有帮助吗?