困惑于从这篇文章找到公式(天真的贝叶斯) [英] Confused to find formula from this article (naive bayes)

查看:104
本文介绍了困惑于从这篇文章找到公式(天真的贝叶斯)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的亲爱的,我看到这篇文章了解天真的贝叶斯。

这里是文章:



朴素贝叶斯分类器 [ ^ ]



到目前为止我理解理论

但我不明白如何得到这个结果



p(重量|男性)= 5.9881e-06< ---这个结果

p(脚尺寸|男性)= 1.3112e-3< ---这个结果

后验分子(男性)=他们的产品= 6.1984e-09< ---这个结果



p(身高|女性)= 2.2346e-1< ---这个结果

p(体重|女性)= 1.6789e-2< ; ---这个结果

p(足尺寸|女性)= 2.8669e-1< ---这个结果

后验分子(女)=他们的产品= 5.3778 e-04< ---这个结果



希望如此我一步一步向我解释得到这个结果。

谢谢亲爱的,

解决方案

不幸的是,上次看到这个用户差不多五年前。



您可能需要回到他正在讨论的维基百科文章,并获得有关如何计算值的一些线索。你也可以研究一下这篇文章的源代码来了解它是如何工作的。



我已经阅读了这篇文章,但无法通过它来解释它我上面描述的步骤。


所有计算使用相同的公式



p(x)= 1 / sqrt( 2 * PI *σ 2 )* exp( - (x - μ) 2 / 2 *σ 2



其中

x是样本值(长度,重量或脚尺寸)
$ b $bμ是平均值
$ b $bσ 2 是方差



因此,男性体重的数字将为

x = 130
$ b $bμ= 176.25
$ b $bσ 2 = 122.92



p(重量) |男)= 1 / sqrt(2 * PI * 122.92)* exp( - (130 - 176.25) 2 /2*122.92)=

1 / 27.79 * exp (-8.70)= 5.9881E-6
(实际上我将值保存在计算器的内存中,所以如果直接使用这些值,结果会有所不同比特币)



然后这只是为脚尺寸做同样的事情

x = 8

μ= 11.25
$ b $bσ 2 = 0.91667

p(英尺|男性)= 1 / sqrt(2 * PI * 0.91667)* exp( - (8 - 11.25) 2 /2*0.91667)=

1 / 2.40 * exp(-5.76)= 1.3112E-3



对于女性来说等等。


hello dear i saw this article to learning about naive bayes.
here is the article :

Naive Bayes Classifier[^]

so far i am understand the theory
but i cant understand how to get this RESULT

p(weight | male) = 5.9881e-06 <--- THIS RESULT
p(foot size | male) = 1.3112e-3 <--- THIS RESULT
posterior numerator (male) = their product = 6.1984e-09 <--- THIS RESULT

p(height | female) = 2.2346e-1 <--- THIS RESULT
p(weight | female) = 1.6789e-2 <--- THIS RESULT
p(foot size | female) = 2.8669e-1 <--- THIS RESULT
posterior numerator (female) = their product = 5.3778e-04 <--- THIS RESULT

wish someone explain to me step by step to get this result.
thank you dear,,

解决方案

Unfortunately, last time this user was seen was almost five years ago.

You may have to get back to the wikipedia article he is talking about, and get some clue about how values are computed. You may also study the source code of said article to catch how it works.

I have read the article, but could not explain it to you without having to go through the steps I described above.


The same formula is used for all the calculation

p(x) = 1/sqrt(2*PI*σ2) * exp(-(x - μ)2/2*σ2)

where
x is the sample value (length, weight or foot size)
μ is the mean value
σ2 is the variance

So in numbers for the weight for the male it will be
x = 130
μ = 176.25
σ2 = 122.92

p(weight|male) = 1/sqrt(2*PI*122.92) * exp(-(130 - 176.25)2/2*122.92) =
1/27.79 * exp(-8.70) = 5.9881E-6
(In reality I kept the values in the memory of the calculator, so if you use these values directly the result will differ a bit)

Then it is just a matter to do the same for the foot size
x = 8
μ = 11.25
σ2 = 0.91667
p(foot|male) = 1/sqrt(2*PI*0.91667) * exp(-(8 - 11.25)2/2*0.91667) =
1/2.40 * exp(-5.76) = 1.3112E-3

And so on for the female.


这篇关于困惑于从这篇文章找到公式(天真的贝叶斯)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆