Chapter 6
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
Naïve Bayes and Probability Density Functions
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
- p34: iHealth data: iHealth.zip
- p35: Republicans or Democrats: house-votes.zip
- p63 : Pima Indian Diabetes Small Data Set pimaSmall.zip
- p67: Pima Indian Diabetes Small Data Set pima.zip
- p71: Final Code It challenge: mpgData.zip