# Naive Bayes

# 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 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.
- It is a probabilistic classifier, which means it predicts on the basis of the probability of an object.
- Some popular examples of Naïve Bayes Algorithm are spam filtration, Sentimental analysis, and classifying articles.

**# Mathematics in Bayes**

# Coding

**# converting the data into numerical data**

**# converting into numpy array**

**# Training and testing**

**# types of mushroom**

**# # Building our Naive Bayes classifier**

We need a function which will compute the prior probability for each of the classes present in the dataset