# Train Naive Based Classifier For (a) I have calculated $$P(G)=\frac{5}{8}$$, $$P(O|G)=\frac{2}{5}$$, $$P(B|G)=\frac{1}{5}$$, $$P(C|G)=\frac{4}{5}$$, and $$P(A|G)=\frac{4}{5}$$. Now how do I calculate the maximum likelihood estimate of these values?

And how do I go about part (b)? I get that $$O,B,C,A$$ are independent so I can multiply them to get joint probability. But for values like $$O_i$$ for sample $$i=9$$, that is just $$0$$, since sample 9 doesn't have outdoor seating. And how am I supposed to calculate $$P(G_i)$$ if I don't know what $$G_9$$ is?

## 1 Answer

1. Done: MLE is a somewhat abstractly defined concept, but in essence it is your best guess at a parameter. In this case we assume that the observed frequency is your best guess.
2. You want to calculate the probabilty of your observation (HasOutdoorSeating=0 in this case), given IsGoodRestaurant=1. That probability is not 0 (check the first sample for instance)
• Am I understanding this correctly for part (b)? For sample 9, I will calculate $P(G=1)P(O=0,B=1,C=0,A=1|G=1)$ and $P(G=0)P(O=0,B=1,C=0,A=1|G=0)$ and choose which ever one is higher. Is that correct? – IrCa May 14 at 16:37
• Yes, that is a partial of the problem you are solving. The next step is that you are approximating the second P by assuming independence. Are you familiar with Bayes Rule? Basically you are calculating which type of restaurant is the most likely candidate to generate the observed variables, times the relative chance that you would encounter such a restaurant. – S van Balen May 16 at 15:22