NB 1
6 flashcards · Mathematics · by J M COOPER
What is Bayes theorem?
P(A|B) = P(B|A)P(A) / P(B)
Explain:
The probability of x given Ci is the product of the probabilities of all elements in x given Ci.
What the conditional independence assumption is and why this is useful.
Conditional independence, doesn’t really hold true most of the time. But empirically (and for theoretical reasons) we frequently get good performance even if this independence assumption is nonsense.
How can errors in a Bayesian classifier be assessed?
using test data Compare observed classes (from the test data) to expected classes (from the NB classifier) If we make few misclassifications, then the evidence is useful for predicting future/unseen examples
Data were supplied by anonymous MSc students taking an AI course at the third oldest university in the English-speaking world. x1 denotes "from Europe" with values Yes and No x2 denotes number of vowels in the first name x3 denotes length of first name, with values Short (≤ 4), Medium (5 or 6), and Long (>≥ 7) x4 is Yes or No, depending on whether the first name ends in a vowel y is the response class, with values Male and Female It’s easy to collect data such as these, and then test the accura…
X = [x1 = N, x2 = 2, x3 = L, x4 = N] Calculate P(y|X) for all y and select the biggest as our prediction. So using Bayes rule: P(y|X) = P(X|y)P(y) / P(X) And assuming independence P(X|y) = P(x1|y)P(x2|y)P(x3|y)P(x4|y) So we need to find P(X|y) for each x1...x4 and y=M,F: P(M) = 6/11 = 0.545 P(x1|M) = 5/6 = 0.833 P(x2|M) = 5/6 = 0.833 P(x3|M) = 2/6 = 0.333 P(x4|M) = 3/6 = 0.5 P(F) = 5/11 = 0.454 P(x1|F) = 2/5 = 0.4 P(x2|F) = 1/5 = 0.2 P(x3|F) = 3/5 = 0.6 P(x4|F) = 3/5 = 0.6 So P(X|M) = 0.833 * 0…
What does a naive Bayesian classifier do and how and why is it naive?
Determines the probability that new data x belongs to a specific class Ci. So for any x, what we want is the Ci that is most likely (from amongst the i). So, we could calculate P(Ci|x) for all i and select the biggest as our prediction. Problem: to do this we need to have P(x|Ci) which could be hard/expensive to figure out. So we assume independence for the x given Ci. We assume: that the probability of x given Ci is the product of the probabilities of all elements in x given Ci. And use that.…