Amazon SageMaker
Developer Guide

Data Formats for K-Nearest Neighbors Training Input

All Amazon SageMaker built-in algorithms adhere to the common input training formats described in Common Data Formats - Training. This topic contains a list of the available input formats for the Amazon SageMaker k-nearest-neighbor algorithm.

CSV

content-type: text/csv; label_size=1

4,1.2,1.3,9.6,20.3

The first label_size columns are interpreted as the label vector for that row.

RECORDIO

content-type: application/x-recordio-protobuf

[ Record = { features = { 'values': { values: [1.2, 1.3, 9.6, 20.3] # float32 } }, label = { 'values': { values: [4] # float32 } } } ] }

On this page: