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.

Review the model for accuracy

Review the model for accuracy

From the course: Learning Amazon SageMaker

Start my 1-month free trial

Review the model for accuracy

- [Instructor] So previously we were able to create a confusion matrix showing how many of the rows we were able to predict correctly, and how many we were able to predict incorrectly. Ideally, we're looking for one single matrix to understand how well the model is working on this test starter set, and we can get that with an accuracy measure. Now accuracy's calculated by the number of classifications that were correct, divided by the total number of classifications that were attempted. So what I'll do here is I'll take this panda's data frame, I'll extract the values of the four values that are shown here, and I'll perform that calculation. So first of all, I'll copy this command and I'll save it as a separate data frame. I'll then add the values function in order to just extract the numbers, excluding the index, excluding the column names. This is what it will look like. Now with the results values, I'll isolate the correct classifications and divide that by the total. I'll use the…

Contents