Naive Bayes
Back to Index
Objective
Learn Naive Bayes
Essentials Reading
Understanding Classifications
Read the basics of classifications
Basics of Naive Bayes
Implementing Naive Bayes in Scikit-Learn
Checklist
Check your knowledge:
- What data NB works best with?
- What are the 3 types of NB?
-
Calculate the probability of Queen card, given I got a face card from a 52 deck of cards - P (queen |
face) |
- First calculate the probability of getting a face card
- calculate the probability of getting a queen card
-
Now calculate the P(queen |
face) |
Exercises
Difficulty Level
★☆☆ - Easy
★★☆ - Medium
★★★ - Challenging
★★★★ - Bonus
EX-1: Practice with synthetic data
Use Scikit’s make_blobs or make_classification to generate some sample data.
Try to separate them using NB
EX-2: SPAM detection
- Here is SMS Spam dataset
- Start with this notebook
- Use NB to predict spam / ham
- Create a confusion matrix
- What is the accuracy of the model
EX-3 - BONUS Lab
- Choose another text or categorical data from data section
- And solve it with naive bayes
More Exercises