K-Means Response Formats - Amazon SageMaker

K-Means Response Formats

All 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 SageMaker k-means algorithm.

JSON Response Format

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

JSONLINES Response Format

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

RECORDIO Response Format

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

CSV Response Format

The first value in each line corresponds to closest_cluster.

The second value in each line corresponds to distance_to_cluster.

1.0,3.0 2.0,5.0