-1

I am currently studying for a machine learning exam and after a lot of googling and studying slides I'm still not entirely sure how a naive bayes density estimator works. Could someone please explain this to me? This course is still pretty basic so please keep it simple if that's possible :)

Here is a question from an old exam that I got stuck on:

What would a naive bayes density estimator trained on table 1 for the "Win" class predict for a case (x1 = I, x3 = C)?

Table 1:

enter image description here

The answer is apparantly: (3/5) * (1/5) = 0,12. But Where does that 3/5 and 1/5 come from?

Thanks for the help!

Knarf
  • 137
  • 1
  • 12

1 Answers1

1

Naive bayes uses two assumptions:

  • features are independent given a class
  • each feature comes from some known apriori family of densities

What it gives us? First lets use the first assumption

P(x1=I, x3=C | y = Win) = P(x1=I | y=Win) P(x3=C | y=Win)

now we have to calulcate each of the "small" probabilities, and we use a definition of conditional probability and a naive frequentialist approach here, by estimating

               P(x=A, y=B)   # samples having x=A and y=B
P(x=A | y=B) = ----------- = ----------------------------
                  P(y=B)         # samples having y=B

\________________________/
   definition of P(a|b)

               \________________________________________/
                    estimator for the assumed family

thus

P(x1=I | y=Win) = 3/5
P(x3=C | y=Win) = 1/5
lejlot
  • 64,777
  • 8
  • 131
  • 164