文档

ALIYUN::PAIPlugin::InferenceJob

更新时间:

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"
        ]
      }
    }
  }
}