Naive Bayes

Naive Bayes

Naive Bayes estimates f1(x),…,fK(x) with the assumption that within the kth class, the p predictors are independent. Mathematically, for k=1,…,K:

fk(x)=fk1(x1)∗fk2(x2)∗⋯∗fkp(xp)

where fkj is the density function of the jth predictor among observations in the kth class.

Naive Bayes is a good estimator where n is not large enough relative to p for us to effectively estimate the joint distribution of the predictors within each class.

The posterior probability of naive Bayes for k=1,…,K is:

Pr(Y=k|X=x)=πk∗fk1(x1)∗fk2(x2)∗⋯∗fkp(xp)∑l=1Kπl∗fl1(x1)∗fl2(x2)∗⋯∗flp(xp)

Estimate fkj using training data x1j,…,xnj using one of the following methods:

Sources: 1

Connect With Me!