Model

更新时间:
复制 MD 格式

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.

FieldTypeDescription
nameStringThe name of the model. Must match the regular expression /^(?!ops_)[a-zA-Z]\w{0,29}$/.
typeStringThe model type. Valid values: pop (popularity model), cp (category prediction model), hot (top search model), hint (hint model), suggest (drop-down suggestions model).
industryStringThe industry the model applies to. Valid values: general, ecommerce, content.
trainTargetStringThe training goal. Valid values: click, buy, cart, collect, like, comment, share, subscribe, gift, download, read, tip.
behaviorEnabledBooleanSpecifies whether to use behavioral data for training. Default value: true. Not all model types support behavioral data.
behaviorFromGroupNameStringThe name of the application whose behavioral data is used. Defaults to the current application.
cronStringThe cron expression that schedules training runs. For cron syntax, see the Linux Crontab documentation.
cronEnabledBooleanSpecifies whether scheduled training is enabled. Default value: true.
availableThresholdFloatThe threshold when the model is qualified. Valid values: 0 to 1.
filterStringA filter expression applied during data import. Supported operators: <, >, =, !=, >=, <=. Separate multiple conditions with commas.
fields[]ObjectThe application fields the model uses for training.
fields[].nameStringThe name of the application field.
fields[].appFieldTypeStringThe 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[].processTypeStringThe processing type for the field. Valid values: reserve, normal.
extendObjectExtended configuration for the model.
extend.useHotQueryBooleanSpecifies whether to use hot query-supported models. We recommend that you use the models.
extend.useHistoryQueryBooleanSpecifies 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.

FieldTypeDescription
idIntegerThe ID of the model.
groupIdStringThe ID of the application the model belongs to.
groupNameStringThe name of the application the model belongs to.
lastTrainingTimeIntegerThe most recent time when the training was complete.
lastModifyTimeIntegerThe most recent time when the model was modified.
aucFloatThe area under curve (AUC) value of the model.
statusStringThe current status of the model. See Model status values.
progressIntegerThe completion percentage of the current training task.
isAlreadyDeployedBooleanSpecifies whether the model has been deployed, or whether one or more models with the same configuration are already available.

Model status values

StatusDescription
train_initThe model is to be trained.
train_pendingThe model is being trained.
validate_failedAn exception related with the data occurred.
train_failedThe training failed.
train_bad_modelThe training succeeded but the model failed the training.
train_successThe training succeeded and the model passed the training.