What is the Naïve Bayes Classifier Algorithm and how does it work?
Naïve Bayes is a predictive modeling algorithm which is very simple yet, very powerful. Also, Naïve Bayes is a machine learning algorithm based on the Bayes Theorem and can be implemented in various classification tasks.
So, before diving into the Naïve Bayes Classifier Algorithm, let’s get familiar with Bayes’ Theorem to obtain a better understanding of the algorithm.
Bayes’ Theorems
Bayes Theorem can be used to obtain probability in the condition where certain other probabilities are known. Bayes’ Theorem states that:
P (X|Y) = (P (Y|X) * P (X)) / P (Y)
Where,
P (X|Y) represents the probability of occurrence of X in accordance to Y,
P (Y|X) represents the probability of occurrence of Y in accordance to X,
P (X) represents the occurrence of X itself,
and P (Y) represents the occurrence of Y itself.
Now, let’s look onto Bayes’ Theorem with an example.
An example of Bayes’ Theorem
Let us suppose that there are 200 people invited to a party. Now, you need to check how many people may wear a formal dress at the party. Also, let’s check if the person wearing the formal dress is a male or female.