Naive Bayes classifier is a simple supervised machine learning approach that can be used for classification tasks. In this presentation, you can learn about this approach and why it is called "Naive" which is one of the common interview questions.
2. What we know when training a model
2
p(X1=x1|Class=1)
Class=1
Class=2
p(X2=x2|Class=1)
p(Xm=xm|Class=1)
3. What do we care about?
3
p(Class=1|X1=x1,X2=x2,…,Xm=xm)=?
Class=1
Class=2
?
4. Bayes rule is useful to figure out the relationship
4
p(A|B)p(B)=p(B|A)p(A)
5. Bayes rule is useful to figure out the relationship
5
p(Class=1|X1=x1,X2=x2,…,Xm=xm)*
p(X1=x1,X2=x2,…,Xm=xm)=
p(X1=x1,X2=x2,…,Xm=xm|Class=1)*p(Class=1)
p(A|B)p(B)=p(B|A)p(A)
6. The relationship looks complicated
6
WWW*p(X1=x1,X2=x2,…,Xm=xm)=
p(X1=x1,X2=x2,…,Xm=xm|Class=1)p(Class=1)
WWW: What We Want
p(Class=1):easy to calculate
7. Naive assumption
7
Naive: Independent contributions of features in classification
p(X1=x1,X2=x2,…,Xm=xm)=p(X1=x1)p(X2=x2)...p(Xm=xm)
p(X1=x1,X2=x2,…,Xm=xm|Class=1)=
p(X1=x1|Class=1)p(X2=x2|Class=1)...p(Xm=xm|Class=1)