Multivariate bernoulli naive bayes

We have found the product as we are trying to find out the prob of a sentence to be found in a class. In the test data, do we check for the probability of the sentence or the word i.e. feature?

Hey @yashikakhurana00, let me explain you in detail :

b here refers to the actual bit value in query point for the xi feature. In this we pass the vector for query document, containing 0 and 1 , 0 means that word is not present and 1 means that word is present. So lets say there is a word ‘sport’ and it is not present in query document, so b=0, and we will calculate value of P(‘sport’ | y=c)^b * ( 1 - P(‘sport’ | y=c )^(1-b) substituting b= 0, we will be calculating finally, ( 1 - P(‘sport’ | y=c ) and this makes sense as well, we are calculating the probability the sport word does not belong to class y = c.

I hope this gives you a better insight of the formula used :+1:
Happy Learning :slight_smile:

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.