2. Naïve Bayes
• It is a classification technique based on Bayes’
Theorem
• Naive Bayes classifier assumes that the
presence of a particular feature in a class is
unrelated to the presence of any other
feature.
3. Why naive
• Even if these features depend on each other
or upon the existence of the other features, all
of these properties independently contribute
to the probability of an object and that is why
it is known as ‘Naive’.
4. Why use naïve bayes
• Naive Bayes model is easy to build
• Useful for very large data sets.
• Outperform even highly sophisticated
classification methods.
5. Naïve bayes formula
• Bayes theorem provides a way of calculating
posterior probability P(c|x) from P(c), P(x) and
P(x|c).
7. Advantages of naïve bayes
• It is easy and fast to predict class of test data
set.
• It also perform well in multi class prediction
• Naive Bayes classifier performs better
compare to other models like logistic
regression
• Require less training data.
• It perform well in case of categorical input
variables compared to numerical variable(s.
13. Naïve bayes in r
• naiveBayes(formula, data, laplace = 0, subset,
na.action = na.pass)
• The formula is traditional Y~X1+X2+…+Xn
• The data is typically a dataframe of numeric or factor
variables.
• laplace provides a smoothing effect
• subset lets you use only a selection subset of your
data based on some boolean filter
• na.action lets you determine what to do when you hit
a missing value in your dataset.