Home / Blog / Data Science Digital Book / Naive Bayes Algorithm

Naive Bayes Algorithm

• July 15, 2023
• 6587
• 47

Meet the Author : Mr. Bharani Kumar

Bharani Kumar Depuru is a well known IT personality from Hyderabad. He is the Founder and Director of Innodatatics Pvt Ltd and 360DigiTMG. Bharani Kumar is an IIT and ISB alumni with more than 18+ years of experience, he held prominent positions in the IT elites like HSBC, ITC Infotech, Infosys, and Deloitte. He is a prevalent IT consultant specializing in Industrial Revolution 4.0 implementation, Data Analytics practice setup, Artificial Intelligence, Big Data Analytics, Industrial IoT, Business Intelligence and Business Management. Bharani Kumar is also the chief trainer at 360DigiTMG with more than Ten years of experience and has been making the IT transition journey easy for his students. 360DigiTMG is at the forefront of delivering quality education, thereby bridging the gap between academia and industry.

A machine learning method called Naive Bayes is based on the probability principle.

The Bayes Theorem. is used to explain how dependent events are related to one another Conditional Probability is the likelihood of occurrence A provided that event B has already occurred.

Y (Whether the email is spam or not) X (Whether the email contains the word lottery or not)
Spam Lottery
Not Spam Lottery
Spam No Lottery
Spam No Lottery
Not Spam No Lottery
Not Spam No Lottery
Not Spam Lottery
Not Spam Lottery
Spam No Lottery
Spam No Lottery

P(Data) = P(Lottery) = No. of times lottery appears in the data / Total no. of emails = 4/10 P(Class) = P(Spam) = No. of times spam appears in the data P(Data) = P(Lottery) = No. of times lottery appears in the data. Considering that emails are spam, (Data | Class) = P(Lottery | Spam) = No. of emails containing the phrase lottery = 1/5. There are five spam emails in all, one of which contains the term lottery.