Question: probability p(xj |y = k). You should also learn the parameter qty=k, which is the prior probability of each class p.r = k]. Report the

 probability p(xj |y = k). You should also learn the parameter

probability p(xj |y = k). You should also learn the parameter qty=k, which is the prior probability of each class p.r = k]. Report the confusion matrix and training accuracy by predicting the class labels of the training set by your trained Bernoulli Naive-Bayes model. The Multivariate Bernoulli model is based on binarj,r data: Every token in the feature vector of a document is associated with the value 1 or 0. The feature vector has to dimensions where m is the number of words in the whole vocabulary; the value 1 means that the word occurs in the particular document, and 0 means that the word does not occur in this document. The Bernoulli trials can be written as: Hum) = \"Pix. mrru w Pit. was\": (be en. Let er. I my} be the mixtmum-likelmod animate em a when word {or taken} 1. occur: in class we, x. was: \"if! where o of.\" is the nulnlx-r ol' documents in the training (leans-ct that contain the Ieeture z. and belong locleas w). o (if, is the number ol'doeuments in the training duaset that belong toelaas \"I. We trained our Bernoulli naive Bayes model on the training data provided in the last assignment in line with the procedure discussed above. The training accuracy and the confusion matrix of the results are discussed below: Confusion man-ix Bernaulli Naive Bayes (without Laplace loathing) The accuracy of the model is pretty low because we aren't looking at the relative equencies of the word in a Bernoulli naive Bayes model. Accuracy = (134+10 +2+1)1'4000 3.63%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!