Skip to content

Latest commit

 

History

History

exercise

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Naive Bayes Classifier from scratch

Exercise

The objective of this excercise is to solidify your understanding of Naive Bayes algorithm by implementing it from scratch. You will be creating a class NaiveBayes and defining the methods in it that learn from data and predict. The exercise notebook consists of detailed notes on Conditional Probability, Bayes Theorem and Naive Bayes Algorithm. It also contains some starter code and instructions where you have to complete the code.

You can refer the solution if you feel stuck somewhere. Also, one thing you need to be make sure is to use log of probabilities that you calculate. This is important because the probabilities you calculate will have very large decimal places but python will store only the 1st 16 places. This could lead to some discrepancies in the result so make sure to use log probabilities. I would also encourage you to comment your code as it is a good practice.

Good luck