1: Introduction
2: Recommendation systems
3: Item-based filtering
4: Classification
5: More on classification
6: Naïve Bayes
7: Unstructured text
8: Clustering

This chapter introduces the Naïve Bayes Classifier.


  • lazy and eager learners
  • a probability refresher
  • Conditional probabilities: a shopping cart example
  • Bayes Theorem
  • Python code for Naïve Bayes
  • The Congressional Voting Records data set
  • Gaussian distributions and the probability density function.
  • Probability density function: the Python implementation
  • How a recommendation system works.

The PDF of the Chapter

Python code

p31: basic Naive Bayes Classifier:

p63: code it challenge:

p64: code it solution:

p66: complete solution using Probability Density Function: