ALIYUN::PAIPlugin::TrainingJob is used to create a training job.
Syntax
{
"Type": "ALIYUN::PAIPlugin::TrainingJob",
"Properties": {
"Algorithm": String,
"CampaignId": String,
"DataPath": String,
"Name": String,
"UserConfig": Map,
"Remark": String,
"WaitForTrainingFinish": Boolean
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
Algorithm | String | Yes | No | The ID of the algorithm to be associated. | None. |
CampaignId | String | Yes | No | The ID of the operational activity to be associated. | None. |
DataPath | String | Yes | No | The path where the data that you want to train is stored. | None. |
Name | String | Yes | No | The name of the training job. | None. |
UserConfig | Map | Yes | No | The user configurations. | None. |
Remark | String | No | No | The remarks. | None. |
WaitForTrainingFinish | Boolean | No | No | Specifies whether to wait until the training job is complete before creating resources. | The maximum waiting time is 40 minutes. |
Return values
Fn::GetAtt
TrainingJobId: the ID of the training job.
Examples
You must change the masked values of properties, such as the CampaignId property, based on your business requirements.
YAML
format
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 customers
Outputs:
TrainingJobId:
Description: The training job id.
Value:
Fn::GetAtt:
- TrainingJob
- TrainingJobId
JSON
format
{
"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 customers"
}
}
},
"Outputs": {
"TrainingJobId": {
"Description": "The training job id.",
"Value": {
"Fn::GetAtt": [
"TrainingJob",
"TrainingJobId"
]
}
}
}
}