Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

K-Means Response Formats

Focus mode
K-Means Response Formats - Amazon SageMaker AI

All SageMaker AI 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 AI 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
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.