Prediction probabilities for test data

We can now review the probabilities for the three classes for all six images in the test data. The following is the code:

# Prediction probabilities
prob <- model %>% predict_proba(testx)
cbind(prob, Predicted_class = pred, Actual = testy)

OUTPUT

Predicted_class Actual [1,] 0.587377548218 0.02450981364 0.38811263442 0 0 [2,] 0.532718658447 0.04708640277 0.42019486427 0 0 [3,] 0.115497209132 0.18486714363 0.69963568449 2 1 [4,] 0.001700860681 0.98481327295 0.01348586939 1 1 [5,] 0.230999588966 0.03030913882 0.73869132996 2 2 [6,] 0.112148292363 0.02054920420 0.86730253696 2 2

Looking at these predicted probabilities, we can make the following observations:

  • Bicycle images are predicted correctly, as shown by the first two samples. However, prediction probabilities are relatively lower at 0.587 and 0.533.
  • The results for car images (rows 3 and 4) are mixed, with the fourth sample, correctly predicted with a high probability of 0.985, but the third car image is misclassified as an airplane with about 0.7 probability.
  • Airplane images are represented by the fifth and sixth samples. The prediction probabilities for these two images are 0.739 and 0.867 respectively. 
  • Although five out of six images are correctly classified, many prediction probabilities are relatively low when compared to the model's performance on training data. 

Therefore, overall, we can say that there is definitely some scope to improve the model's performance further. In the next section, we will explore improving the model's performance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset