对时序数据的终端节点请求 - Amazon SageMaker

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

对时序数据的终端节点请求

Cl SageMaker arify 处理任务将数据序列化为任意 JSON 结构(MIME 类型:application/json)。为此,必须为分析配置 content_template 参数提供模板字符串。Clarify 处理 SageMaker 任务使用它来构造提供给您的模型的 JSON 查询。 content_template包含数据集中的一条或多条记录。您还必须为提供模板字符串record_template,该字符串用于构造每条记录的 JSON 结构。然后将这些记录插入到content_template。有关content_type或的更多信息dataset_type,请参阅配置分析

注意

由于content_templaterecord_template是字符串参数,因此在配置中,任何属于 JSON 序列化结构的双引号字符 (“) 都应记为转义字符。例如,如果要在 Python 中对双引号进行转义,则可以为输入以下值content_template

'$record'

下表显示了序列化 JSON 请求负载的示例,以及构造这些负载所需的相应record_template参数content_template和参数。

应用场景 端点请求负载(字符串表示形式) content_template record_template

一次只能录制一张唱片

{"target": [1, 2, 3],"start": "2024-01-01 01:00:00"}

'$record'

'{"start": $start_time, "target": $target_time_series}'

$related_time_series和的单张记录 $static_covariates

{"target": [1, 2, 3],"start": "2024-01-01 01:00:00","dynamic_feat": [[1.0, 2.0, 3.0],[1.0, 2.0, 3.0],"cat": [0,1]}

'$record'

'{"start": $start_time, "target": $target_time_series, "dynamic_feat": $related_time_series, "cat": $static_covariates}'

多条记录

{"instances": [{"target": [1, 2, 3],"start": "2024-01-01 01:00:00"}, {"target": [1, 2, 3],"start": "2024-01-01 02:00:00"}]}

'{"instances": $records}'

'{"start": $start_time, "target": $target_time_series}'

使用和进行多条$related_time_series记录 $static_covariates

{"instances": [{"target": [1, 2, 3],"start": "2024-01-01 01:00:00","dynamic_feat": [[1.0, 2.0, 3.0],[1.0, 2.0, 3.0],"cat": [0,1]}, {"target": [1, 2, 3],"start": "2024-01-01 02:00:00","dynamic_feat": [[1.0, 2.0, 3.0],[1.0, 2.0, 3.0],"cat": [0,1]}]}

'{"instances": $records}'

''{"start": $start_time, "target": $target_time_series, "dynamic_feat": $related_time_series, "cat": $static_covariates}'