November 2018
Intermediate to advanced
492 pages
12h 19m
English
In order to predict the label of a new image, x, we need to find the label, j, for which the posterior probability, Pr(y=j|x), is maximum. It can be computed using the Bayes rule, as follows:

The following code block shows how to predict the labels of the test dataset using the generative model and how to compute the number of errors the model makes on the test dataset. As can be seen, the accuracy of the test dataset is 95.6%, which is a little less than the 1-NN classifier:
# Compute log Pr(label|image) for each [test image,label] pair.k = 10score ...
Read now
Unlock full access