What is Naive Bayes?

An introduction to machine learning algorithms

--

Naive Bayes algorithm is a supervised learning algorithm, which is based on Bayes theorem, it used in a wide variety of classification tasks in machine learning.

In this article, I would be giving you a detailed explanation and how this model works.

What is Naive Bayes?

The Naive Bayes Classifier comes in the field of supervised learning and it’s a classification algorithm in the development of fast machine learning models that can make accurate predictions. It’s a probabilistic classifier, therefore it bases its predictions on the likelihood that an object will be found. The Naive Bayes Algorithm is commonly used for text classification, spam filtration, and sentiment analysis.

What is Bayes Theorem?

The Bayes’ Theorem is a simple formula that can be used to calculate conditional probabilities.
conditional probability — A measure of the possibility of an event occurring if another event has already occurred is called conditional probability (by assumption, presumption, assertion, or evidence).

Posterior probability (P(A|B)): is the probability of hypothesis A on the observed event B.

Likelihood probability P(B|A): stands for Likelihood, which is the probability of the evidence provided that a hypothesis’ probability is true.

Prior Probability (P(A)): is the probability of a hypothesis before seeing the evidence.
Marginal Probability P(B): stands for Probability of Evidence Marginal Probability.

How Naive Bayes’ Classifier works?

Let’s say we have an email dataset of and a target variable called “Spam” and “not spam”. So, using this dataset, we must select whether a mail can be spam or not spam.

Convert the given dataset into frequency tables.

  1. Find the probability of given features to generate a Likelihood table.
  2. Calculate the posterior probability using Bayes’ theorem.

Types of Naive Bayes Model

We have 3 types of model in Naive Bayes

Gaussian

The Gaussian model presume a normally distributed distribution of attributes. If predictors use continuous values rather than discrete values, the model assumes that continuous values are taken from a Gaussian distribution.

Multinomial

The Multinomial Nave Bayes classifier is used when the data is multinomially distributed. It is mostly employed to address issues with document classification, such as figuring out which category a document falls into, such as Sports, Politics, or Education.

Bernoulli

With the exception that the predictor variables in the Bernoulli classifier are independent Boolean variables, it is similar to the Multinomial classifier. For instance, check to see if a word is used in a document. This paradigm is well-known for tasks involving document categorization.

Advantages of Naive Bayes Classifier:

  • A quick and straightforward machine learning strategy for predicting a class of datasets is nave bayes.
  • It outperforms the other algorithms when making predictions for several classes.
  • It is the most often used solution for text categorization issues.

If you like my article and efforts towards the community, you may support and encourage me, by simply buying coffee for me

Conclusion

so I hope today you guys have a good understanding in the near future Naive Bayes I would be making more articles in which I will be explaining moremodels and would be making an article to make implement Naive Bayes with source code.

--

--