From the course: Amazon Web Services Machine Learning Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use model from SageMaker endpoint

Use model from SageMaker endpoint - Amazon Web Services (AWS) Tutorial

From the course: Amazon Web Services Machine Learning Essential Training

Start my 1-month free trial

Use model from SageMaker endpoint

- [Instructor] Now we're going to validate our model for use. We're going to generate a classification from a single observation from the train model using the endpoint. So you can see in this code cell we're setting a result variable equal to K-Means predictor calling predict against the training set and we're going to print the result. And I'm going to click in here and press shift-return to execute this cell. And you can see that we get this output in the format adjacent. The key is closest cluster. The value is a float 32 tensor and it's a 3, which is what we're expecting. And the label is the distance to cluster and the value is a tensor. This is the result that we expected. So a single prediction works. So next we can do a whole batch and see how well the clustering works. So we're going to scroll down and use this time value again and set the result to K-Means predictor predict from a set. And we're going to set a clusters variable equal to a label the closest cluster for r in…

Contents