SageMaker Kmeans inference

Make sure you read this on training a model with Kmeans before deploying your model to an endpoint.

Deploying your Kmeans model is as simple as:

kmeans_predictor = kmeans.deploy(initial_instance_count=1, 
                                 instance_type='ml.t2.medium')

Once the endpoint is deployed, you can use your train data and determine which cluster each training row belongs to:

result=kmeans_predictor.predict(train_data)