Chapters
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.

Contents

  • 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: naiveBayes.py

p63: code it challenge: naiveBayesDensityFunctionTraining.py

p64: code it solution: naiveBayesDensityFunctionTrainingSolution.py

p66: complete solution using Probability Density Function: naiveBayesDensityFunction.py

Data