ALIYUN::PAIPlugin::TrainingJob类型用于创建训练任务。
语法
{
  "Type": "ALIYUN::PAIPlugin::TrainingJob",
  "Properties": {
    "Algorithm": String,
    "CampaignId": String,
    "DataPath": String,
    "Name": String,
    "UserConfig": Map,
    "Remark": String,
    "WaitForTrainingFinish": Boolean
  }
}属性
属性名称  | 类型  | 必须  | 允许更新  | 描述  | 约束  | 
Algorithm  | String  | 是  | 否  | 关联算法ID。  | 无  | 
CampaignId  | String  | 是  | 否  | 关联运营活动ID。  | 无  | 
DataPath  | String  | 是  | 否  | 训练数据路径。  | 无  | 
Name  | String  | 是  | 否  | 训练任务名称。  | 无  | 
UserConfig  | Map  | 是  | 否  | 用户配置。  | 无  | 
Remark  | String  | 否  | 否  | 备注。  | 无  | 
WaitForTrainingFinish  | Boolean  | 否  | 否  | 是否等待训练任务完成后再创建资源。  | 最长等待时间为40分钟。  | 
返回值
Fn::GetAtt
TrainingJobId:训练任务ID。
示例
说明 
请您根据实际情况更改脱敏的参数取值,例如CampaignId。
YAML格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  TrainingJob:
    Type: ALIYUN::PAIPlugin::TrainingJob
    Properties:
      DataPath: https://bucket.region.aliyuncs.com/folder/
      CampaignId: 0a54e195-03e2-40bd-869d-b71cb302****
      UserConfig:
        start_date: '20210101'
        end_date: '20210131'
      Algorithm: user_recall
      Name: VIP客户
Outputs:
  TrainingJobId:
    Description: The training job id.
    Value:
      Fn::GetAtt:
        - TrainingJob
        - TrainingJobId
JSON格式
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
  },
  "Resources": {
    "TrainingJob": {
      "Type": "ALIYUN::PAIPlugin::TrainingJob",
      "Properties": {
        "DataPath": "https://bucket.region.aliyuncs.com/folder/",
        "CampaignId": "0a54e195-03e2-40bd-869d-b71cb302****",
        "UserConfig": {
          "start_date": "20210101",
          "end_date": "20210131"
        },
        "Algorithm": "user_recall",
        "Name": "VIP客户"
      }
    }
  },
  "Outputs": {
    "TrainingJobId": {
      "Description": "The training job id.",
      "Value": {
        "Fn::GetAtt": [
          "TrainingJob",
          "TrainingJobId"
        ]
      }
    }
  }
}
                        该文章对您有帮助吗?