

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# 線形学習のレスポンス形式
<a name="LL-in-formats"></a>

## JSON レスポンス形式
<a name="LL-json"></a>

Amazon SageMaker AI の組み込みアルゴリズムはすべて、「[Common Data Formats - Inference](https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html)」で説明されている一般的な入力推論形式に従います。以下は、SageMaker AI 線形学習アルゴリズムで使用可能な出力形式です。

**バイナリの分類**

```
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 レスポンス形式
<a name="LL-jsonlines"></a>

**バイナリの分類**

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

**複数クラスの分類**

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

**回帰**

```
{"score": 0.4}
```

## RECORDIO レスポンス形式
<a name="LL-recordio"></a>

**バイナリの分類**

```
[
    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
            }   
        }
    }
]
```