From the course: Learning Amazon SageMaker

Unlock the full course today

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

Test deployed model for single record

Test deployed model for single record

From the course: Learning Amazon SageMaker

Start my 1-month free trial

Test deployed model for single record

- [Instructor] In the previous steps, we have trained a model, and we've also deployed that model. And that model is referenced by the xgb_predictor object that we still have in the Jupyter Notebook here. So, in the next example, I'll run through how to use that as a tool to get an inference for one row out of our data set. So, first of all, we need to set the type of content, the serializer, so the content is text/csv, that it's expecting. Update the object to have those settings. I'll then reference the test_data, Panda's dataframe that we created earlier on. So we created a train data and a validation data dataframe, which we use to train the model, but we'll use this for validation. So the shape of this model, so shape meaning the number of rows and the number of columns, is 334 by 70. What we'll look to do is we'll grab the first row using the head function, one. That will extract the first row from the dataframe. And then we'll convert it into a NumPy array. So the NumPy array…

Contents