Naive Bayes Part 2


In this python machine learning tutorial for beginners we will build email spam classifier using naive bayes algorithm. We will use sklearn CountVectorizer to convert email text into a matrix of numbers and then use sklearn MultinomialNB classifier to train our model. The model score with this approach comes out to be very high (around 98%). Sklearn pipeline allows us to handle pre processing transformations easily with its convenient api. In the end there is an exercise where you need to classify sklearn wine dataset using naive bayes.

Exercise: https://github.com/codebasics/py/blob/master/ML/14_naive_bayes/exercise.md Code:https://github.com/codebasics/py/blob/master/ML/14_naive_bayes/14_naive_bayes_2_email_spam_filter.ipynb

Topics that are covered in this Video:

00:00 explore spam email dataset

02:33 sklearn CountVectorizer

04:30 types of naive bayes classifiers

05:23 sklearn MultinomialNB classifier

06:48 sklearn pipeline

09:35 Exercise