ALIYUN::PAIPlugin::InferenceJob类型用于创建预测任务。
语法
{
"Type": "ALIYUN::PAIPlugin::InferenceJob",
"Properties": {
"Algorithm": String,
"CampaignId": String,
"DataPath": String,
"Name": String,
"TrainingJobId": String,
"TargetPath": String,
"UserConfig": Map,
"Remark": String,
"WaitForInferenceFinish": Boolean
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Algorithm | String | 是 | 否 | 关联算法ID。 | 无 |
CampaignId | String | 是 | 否 | 关联运营活动ID。 | 无 |
DataPath | String | 是 | 否 | 预测数据路径。 | 无 |
Name | String | 是 | 否 | 预测任务名称。 | 无 |
TrainingJobId | String | 是 | 否 | 关联训练任务。 | 无 |
TargetPath | String | 是 | 否 | 输出数据路径 | 无 |
UserConfig | Map | 是 | 否 | 用户配置。 | 无 |
Remark | String | 否 | 否 | 备注。 | 无 |
WaitForInferenceFinish | Boolean | 否 | 否 | 是否等待推理任务完成后再创建资源。 | 最长等待时间为40分钟。 |
返回值
Fn::GetAtt
InferenceJobId:预测任务ID。
GroupId:关联人群ID。
示例
说明
请您根据实际情况更改脱敏的参数取值,例如CampaignId。
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
DataPath:
Type: String
Description:
en: The input data path of inference job.
Required: true
TrainingJobId:
Type: String
Description:
en: The training job id of inference job.
Required: true
CampaignId:
Type: String
Description:
en: The campaign id of inference job.
Required: true
TargetPath:
Type: String
Description:
en: The output result path of inference job.
Required: true
UserConfig:
Type: Json
Description:
en: The user config of inference job.
Required: true
Algorithm:
Type: String
Description:
en: The algorithm of inference job.
Required: true
WaitForInferenceFinish:
Type: Boolean
Description:
en: Whether resource creation waits for the inference task to complete.The longest waiting time is 40 minutes
Required: false
Default: true
Remark:
Type: String
Description:
en: The remark of inference job.
Required: false
Name:
Type: String
Description:
en: The name of inference job.
Required: true
Resources:
InferenceJob:
Type: ALIYUN::PAIPlugin::InferenceJob
Properties:
DataPath: https://bucket.region.aliyuncs.com/folder/
TrainingJobId: '123'
CampaignId: 0a54e195-03e2-40bd-869d-b71cb302****
TargetPath: https://bucket.region.aliyuncs.com/folder/
UserConfig: {}
Algorithm: user_recall
Name: VIP客户
Outputs:
InferenceJobId:
Description: The id of inference job.
Value:
Fn::GetAtt:
- InferenceJob
- InferenceJobId
GroupId:
Description: The related group id of infernce job result.
Value:
Fn::GetAtt:
- InferenceJob
- GroupId
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"DataPath": {
"Type": "String",
"Description": {
"en": "The input data path of inference job."
},
"Required": true
},
"TrainingJobId": {
"Type": "String",
"Description": {
"en": "The training job id of inference job."
},
"Required": true
},
"CampaignId": {
"Type": "String",
"Description": {
"en": "The campaign id of inference job."
},
"Required": true
},
"TargetPath": {
"Type": "String",
"Description": {
"en": "The output result path of inference job."
},
"Required": true
},
"UserConfig": {
"Type": "Json",
"Description": {
"en": "The user config of inference job."
},
"Required": true
},
"Algorithm": {
"Type": "String",
"Description": {
"en": "The algorithm of inference job."
},
"Required": true
},
"WaitForInferenceFinish": {
"Type": "Boolean",
"Description": {
"en": "Whether resource creation waits for the inference task to complete.The longest waiting time is 40 minutes"
},
"Required": false,
"Default": true
},
"Remark": {
"Type": "String",
"Description": {
"en": "The remark of inference job."
},
"Required": false
},
"Name": {
"Type": "String",
"Description": {
"en": "The name of inference job."
},
"Required": true
}
},
"Resources": {
"InferenceJob": {
"Type": "ALIYUN::PAIPlugin::InferenceJob",
"Properties": {
"DataPath": "https://bucket.region.aliyuncs.com/folder/",
"TrainingJobId": "123",
"CampaignId": "0a54e195-03e2-40bd-869d-b71cb302****",
"TargetPath": "https://bucket.region.aliyuncs.com/folder/",
"UserConfig": {},
"Algorithm": "user_recall",
"Name": "VIP客户"
}
}
},
"Outputs": {
"InferenceJobId": {
"Description": "The id of inference job.",
"Value": {
"Fn::GetAtt": [
"InferenceJob",
"InferenceJobId"
]
}
},
"GroupId": {
"Description": "The related group id of infernce job result.",
"Value": {
"Fn::GetAtt": [
"InferenceJob",
"GroupId"
]
}
}
}
}
文档内容是否对您有帮助?