ADVERTISEMENT
ADVERTISEMENT

Home » Machine Learning/Artificial Intelligence

Naive Bayes Algorithm in Machine learning

In this article, we are going to learn about Naive Bayes Algorithm in Machine learning, what is the algorithm and how it will be solved?
Submitted by Anamika Gupta, on June 08, 2018

Naive Bayes Algorithm

Naive Bayes is basically used for text learning. Using this algorithm we trained machine from text.

Let’s understand it with an example:

Question:

There are two writers SARA and CHRIS .The probability of writing the word "LOVE" ,"DEAL" and "LIFE" is 0.1,0.8 and 0.1 respectively by CHRIS and 0.5,0.2 and 0.3 by SARA. The probability of sending mail by CHRIS and SARA is 0.5, and then answer this question:

  1. Who will more likely send the mail "LOVE LIFE"?
  2. What is the probability that "LOVE LIFE" is send by CHRIS?

Solution:

Ans 1)

P(CHRIS,"LOVE LIFE")=P(CHRIS) *P("LOVE LIFE"|CHRIS)
    = 0.5 * (0.1 *0.1) =0.005
P(SARA,"LOVE LIFE")=P(SARA) * P("LOVE LIFE"|SARA)
    = 0.5 * (0.5 * 0.3)
    = 0.075

Hence, SARA is more likely to send mail "LOVE LIFE".

Ans 2)

Normalize:
P("LOVE LIFE")=P(CHRIS,"LOVE LIFE")+P(SARA,"LOVE LIFE") = 0.005+0.075 = 0.08 Probability of sending mail "LOVE LIFE" by CHRIS (P(CHRIS|"LOVE LIFE")) = P(CHRIS,"LOVE LIFE")/P("LOVE LIFE") = 0.005/0.08 = 0.0625

Similarly for probability of sending mail by SARA we can divide 0.075 by the total of two i.e. 0.08.

HENCE THIS PROCESS IS THE ALGORITHM FOR BAYES RULE.

ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.