Go ProSign in

This Lesson is for Members

Subscribe today and get access to all lessons! Plus direct HD download for offline use, enhances transcripts, member comment forums, and iTunes "podcast" RSS feed. Level up your skills now!

Unlock This Lesson

Already subscribed? Sign In

Implement a Naive Bayes Classifier in Python and Scikit-learn to Categorize Text

We’ll use this probabilistic classifier to classify text into different news groups.

There are several types of Naive Bayes classifiers in scikit-learn. We will be using the Multinomial Naive Bayes model, which is appropriate for text classification. More can be found at Scikit-learn.

We'll also look at how to visualize the confusion matrix using pandas_ml.

To install pandas_ml, type:

$ pip install pandas_ml

into your terminal, or install it with your installer of choice.

You must be a Member to view code