机器学习朴素贝叶斯算法_机器学习中的朴素贝叶斯算法

机器学习朴素贝叶斯算法

朴素贝叶斯算法 (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:

SARA和CHRIS有两个作者。CHRIS的单词“ LOVE”,“ DEAL”和“ LIFE”的书写概率分别为SARA和0.5、0.2和0.3,分别为0.1,0.8和0.1。 CHRIS和SARA发送邮件的概率为0.5,然后回答以下问题:

  1. Who will more likely send the mail "LOVE LIFE"?

    谁更有可能发送邮件“ LOVE LIFE”?

  2. What is the probability that "LOVE LIFE" is send by CHRIS?

    CHRIS发送“ LOVE LIFE”的可能性是多少?

Solution:

解:

Ans 1)

答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)

答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.

同样,对于通过SARA发送邮件的可能性,我们可以将0.075除以2的总和,即0.08。

HENCE THIS PROCESS IS THE ALGORITHM FOR BAYES RULE.

因此,此过程是贝叶斯规则的算法。

翻译自: https://www.includehelp.com/ml-ai/naive-bayes-algorithm.aspx

机器学习朴素贝叶斯算法

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值