3.2 Train a multinomial Naive Bayes Classifier with no smoothing using D1, D2, D3, D4. Let's train a multinomial Naive Bayes Classifier with no smoothing using the training documents (i.e., D1, D2, D3, D4). Note each record has three tab separated fields: -Document ID -class (where 11 denotes Chinese; and 00 denotes not Chinese) -document content Document ID class document content Training D1 1 Chinese Beijing Chinese D2 1 Chinese Chinese Shanghai D3 1 Chinese Macao D4 0 Tokyo Japan Chinese Test D5 ? Chinese Chinese Chinese Tokyo Japan The word class conditionals, ??(????|?????) , are given in the following table. word Pr(word |Class==0) Pr(word|Class==1) Chinese 1/3 5/8 Beijing 0 1/8 Shanghai 0 1/8 Macao 0 1/8 Tokyo 1/3 0 Japan 1/3 0 Calculate the posterior probabilities for D5 given an unsmoothed MNB model D5 Chinese Chinese Chinese Tokyo Japan What is the class of D5? What is the posterior probabilities of D5 (Pr(Class=0|D5) versus Pr(Class=1|D5)?
3.2 Train a multinomial Naive Bayes Classifier with no smoothing using D1, D2, D3, D4.
Let's train a multinomial Naive Bayes Classifier with no smoothing using the training documents (i.e., D1, D2, D3, D4). Note each record has three tab separated fields:
-Document ID
-class (where 11 denotes Chinese; and 00 denotes not Chinese)
-document content
Document ID class document content
Training D1 1 Chinese Beijing Chinese
D2 1 Chinese Chinese Shanghai
D3 1 Chinese Macao
D4 0 Tokyo Japan Chinese
Test D5 ? Chinese Chinese Chinese Tokyo Japan
The word class conditionals, ??(????|?????) , are given in the following table.
word Pr(word |Class==0) Pr(word|Class==1)
Chinese 1/3 5/8
Beijing 0 1/8
Shanghai 0 1/8
Macao 0 1/8
Tokyo 1/3 0
Japan 1/3 0
Calculate the posterior probabilities for D5 given an unsmoothed MNB model
D5 Chinese Chinese Chinese Tokyo Japan
What is the class of D5? What is the posterior probabilities of D5 (Pr(Class=0|D5) versus Pr(Class=1|D5)?
Trending now
This is a popular solution!
Step by step
Solved in 2 steps