Amazon SageMaker
Developer Guide

k-means Response Formats

All Amazon SageMaker built-in algorithms adhere to the common input inference format described in Common Data Formats - Inference. This topic contains a list of the available output formats for the Amazon SageMaker k-means algorithm.

JSON

{ "predictions": [ { "closest_cluster": 1.0, "distance_to_cluster": 3.0, }, { "closest_cluster": 2.0, "distance_to_cluster": 5.0, }, .... ] }

JSONLINES

{"closest_cluster": 1.0, "distance_to_cluster": 3.0} {"closest_cluster": 2.0, "distance_to_cluster": 5.0}

RECORDIO

[ Record = { features = {}, label = { 'closest_cluster': { keys: [], values: [1.0, 2.0] # float32 }, 'distance_to_cluster': { keys: [], values: [3.0, 5.0] # float32 }, } } ]

On this page: