Chapter 4. Classifying with probability theory: naïve Bayes
This chapter covers
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 touched on probability a bit in chapter 3 when we were calculating the probability of a feature taking a given value. We calculated the probability by counting the number of times the feature equals that value divided by the total number of instances in the dataset. We’re going to expand a little from there in this chapter.