线性学习器响应格式 - Amazon SageMaker
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

线性学习器响应格式

JSON 响应格式

所有 Amazon SageMaker 内置算法遵循常见数据格式 - 推理中所述的常见输入推理格式。下面是 SageMaker 线性学习器算法的可用输出格式。

二元分类

let response = { "predictions": [ { "score": 0.4, "predicted_label": 0 } ] }

多元分类

let response = { "predictions": [ { "score": [0.1, 0.2, 0.4, 0.3], "predicted_label": 2 } ] }

回归

let response = { "predictions": [ { "score": 0.4 } ] }

JSONLINES 响应格式

二元分类

{"score": 0.4, "predicted_label": 0}

多元分类

{"score": [0.1, 0.2, 0.4, 0.3], "predicted_label": 2}

回归

{"score": 0.4}

RECORDIO 响应格式

二元分类

[ Record = { features = {}, label = { 'score': { keys: [], values: [0.4] # float32 }, 'predicted_label': { keys: [], values: [0.0] # float32 } } } ]

多元分类

[ Record = { "features": [], "label": { "score": { "values": [0.1, 0.2, 0.3, 0.4] }, "predicted_label": { "values": [3] } }, "uid": "abc123", "metadata": "{created_at: '2017-06-03'}" } ]

回归

[ Record = { features = {}, label = { 'score': { keys: [], values: [0.4] # float32 } } } ]