Naïve Bayes algorithm is a supervised learning algorithm, which is based on Bayes theorem and used for solving classification problems.
It is mainly used in text classification that includes a high-dimensional training dataset.
Naïve Bayes Classifier is one of the simple and most effective Classification algorithms which helps in building the fast machine learning models that can make quick predictions.
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:
P(A/B)=(P(B/A) P(A))/P(B)
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.
-Data Pre-processing step
-Fitting Naive Bayes to the Training set
-Predicting the test result
-Test accuracy of the result(Creation of Confusion matrix)
-Visualizing the test set result.
Salary dataset:- To Prepare a classification model using Naive Bayes for salary dataset.
Iris dataset:- To Classify Species using Naive Bayes
Diabetes dataset:- To Classify Diabetes using Naive Bayes
Python
The Codes regarding Classification using Naive Bayes for datasets Salary, Iris, Diabetes are present in this repository in detail