本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
Amazon SageMaker AI 提供多種回應格式,用於從 Factorization Machines 模型取得推論,例如 JSON、JSONLINES 和 RECORDIO,以及用於二進位分類和迴歸任務的特定結構。
JSON 回應格式
二進位分類
let response = {
"predictions": [
{
"score": 0.4,
"predicted_label": 0
}
]
}
迴歸
let response = {
"predictions": [
{
"score": 0.4
}
]
}
JSONLINES 回應格式
二進位分類
{"score": 0.4, "predicted_label": 0}
迴歸
{"score": 0.4}
RECORDIO 回應格式
二進位分類
[
Record = {
features = {},
label = {
'score’: {
keys: [],
values: [0.4] # float32
},
'predicted_label': {
keys: [],
values: [0.0] # float32
}
}
}
]
迴歸
[
Record = {
features = {},
label = {
'score’: {
keys: [],
values: [0.4] # float32
}
}
}
]