0% found this document useful (0 votes)
13 views

Naïve Bayes Classifier Algorithm

Naive Bayes Classifier Algorithm

Uploaded by

21x51a3249
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Naïve Bayes Classifier Algorithm

Naive Bayes Classifier Algorithm

Uploaded by

21x51a3249
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

NAÏVE BAYES

CLASSIFIER ALGORITHM
 Naïve Bayes algorithm is a supervised learning
algorithm, which is based on Bayes theorem and
used for solving classification problems.
 It is a probabilistic classifier, which means it
predicts on the basis of the probability of an object.
Naïve: It is called Naïve because it assumes that the
occurrence of a certain feature is independent of the
occurrence of other features.
Bayes: It is called Bayes because it depends on the
principle of Bayes' Theorem.
Loaded: 0.37%
Â

Bayes' Theorem:
• Bayes' theorem is also known as Bayes' Rule or Bayes' law,
which is used to determine the probability of a hypothesis with
prior knowledge. It depends on the conditional probability.
• The formula for Bayes' theorem is given as:
Where,
P(A|B) is Posterior probability: Probability of hypothesis A on the observed
event B.
P(B|A) is Likelihood probability: Probability of the evidence given that the
probability of a hypothesis is true.
P(A) is Prior Probability: Probability of hypothesis before observing the
evidence.
P(B) is Marginal Probability: Probability of Evidence.
Naïve Bayes classifier steps

Step 1: First construct a frequency table. A frequency table is


drawn for each attribute against the target outcome.
Step 2: Identify the cumulative probability.
Step 3: Calculate probability through normalization by applying
the below formula
P(Yes) will give the overall probability of favorable
condition in the given scenario.
P(No) will give the overall probability of non favorable
condition in the given scenario.
Advantages of Naïve Bayes Classifier:
1. Naïve Bayes is one of the fast and easy ML algorithms to
predict a class of datasets.
2. It can be used for Binary as well as Multi-class
Classifications.
3. It performs well in Multi-class predictions as compared to
the other Algorithms.
4. It is the most popular choice for text classification
problems.
Disadvantages of Naïve Bayes Classifier:
Naive Bayes assumes that all features are independent or
unrelated, so it cannot learn the relationship between features.
Applications of Naïve Bayes Classifier:
1. Text Classification
2. Spam Filtering
3. Hybrid Recommender system
4. Online Sentimental anlysis
EXAMPLE
TEST DATA
Step-1
Step-2
Step-3

by normalizing the above two probabilities, we can ensure


that the sum of these two probabilities is 1.

You might also like