Chapter 4. Classifying with probability theory: naïve Bayes


This chapter covers
  • Using probability distributions for classification
  • Learning the naïve Bayes classifier
  • Parsing data from RSS feeds
  • Using naïve Bayes to reveal regional attitudes


In the first two chapters we asked our classifier to make hard decisions. We asked for a definite answer for the question “Which class does this data instance belong to?” Sometimes the classifier got the answer wrong. We could instead ask the classifier to give us a best guess about the class and assign a probability estimate to that best guess.

Probability theory forms the basis for many machine-learning algorithms, so it’s important that you get a good grasp on this topic. We ...

Get Machine Learning in Action now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.