`
BradyZhu
  • 浏览: 261328 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

机器学习系列(6)_从白富美相亲看特征预处理与选择(下)

 
阅读更多

作者:龙心尘 &&寒小阳
时间:2016年1月。
出处:
http://blog.csdn.net/longxinchen_ml/article/details/50493845
http://blog.csdn.net/han_xiaoyang/article/details/50503115
声明:版权所有,转载请联系作者并注明出处

1. 剧情一:挑螃蟹的秘密

李雷与韩梅梅的关系发展得不错,趁国庆休假一起来天津玩。今天,李雷十分神秘地请韩梅梅去一家餐馆吃螃蟹。韩梅梅大失所望,这个餐馆很不起眼,感觉就像路边的老食堂。菜单都用粉笔写在黑板上,一点都不高档。一看价格,满黄螃蟹120块钱一只!这也太贵了。

李雷看到了韩梅梅的神情,笑着解释道:“这家店老板有一个绝活——会看螃蟹。他能保证120块的螃蟹就是满黄。如果拆开来不是,这个螃蟹就不要钱,再换一个。靠着老板的绝活,这家店已经是几十年的老店了,在当地非常有名气。郭德纲、赵丽蓉这些天津社会名流都来这家店吃过螃蟹。”

韩梅梅将信将疑。拆开螃蟹,饱满的蟹黄喷薄欲出。韩梅梅边吃边惊叹:“从没有吃个这么好吃的螃蟹!”

李雷接着说:“老板的绝活密不外传,几十年来都自己上货。虽说是一个大老板,一年到头满身海鲜味。而且他也不开分店。”

韩梅梅说:“那是,这么高明的绝活只有他自己知道才能挣钱啊。”这时,韩梅梅拂面而笑,突然想考一考自己的相亲对象,说:“李大码农,你不是做机器学习的吗?如果要你去用机器学习挑满黄的螃蟹,你怎么做?”

2. 初步划定特征的范围,获取特征

李雷早就想过这个问题了。长期的职业素养让他对任何事情都想用机器学习的方法去鼓捣。李雷的基本思路是这样的,我们尽可能观察螃蟹更多的特征,从中找出与“螃蟹满黄”最相关的特征来,帮助我们去判断。当然特征有非常多,我们可以先头脑风暴一下:

  1. 一些直观的特征:包括蟹壳的颜色和光泽度、钳子的大小、肚脐的形状、螃蟹腿的粗细和长度、眼睛的大小和颜色光泽、螃蟹的品种、重量、体积、腰围等等……
  2. 一些需要在互动过程中观察到的特征:螃蟹钳子的力量,对外界刺激的反应,用筷子触碰螃蟹眼睛后的反应,螃蟹行动的速度……
  3. 还有一些外部环境的特征: 收获螃蟹的季节,培养螃蟹的水域……

韩梅梅插话到:“这么多特征我头都大了,你还有完没完?”

其实,如果真要穷举出所有的特征可能永远也举不完。但是我们目的很明确——判断螃蟹是否是满黄。所以我们只关心跟这个问题(“标签”)相关的特征,它们只占所有特征中很小一部分。怕就怕一些糊涂的需求方连目的都不明确就要求一通乱搞,即便出来了一堆结果,也不知道有什么用。

头脑风暴完之后,很重要的一点就是找到对这个问题有长期经验的人,虚心向他们学习。人脑其实是一个很好的特征筛选器,这些经验可以给我们非常多的指导和启发,极大地减少我们试错的工作量。比如我们可以直接去找海鲜市场问螃蟹贩子,去田间地头找螃蟹养殖户,去海鲜饭店去问有经验的采购员和厨师……他们的最一线的经验是特征工程中的宝贵财富

但这里需要考虑将经验转换成可量化的指标,才能便于机器学习。比如人们可能会说螃蟹很“活跃”、很“精神”,或者很“慵懒”。这些特征需要转换成一些可量化指标去衡量,具体怎么转换也有很大学问。

接下来要考虑的问题是对这些特征的可用性进行简单的评估。比如:

  1. 特征获取、描述难度
  2. 数据的规模
  3. 特征的准确率
  4. 特征的覆盖率
  5. 其他

我们通过明确目标,头脑风暴,咨询专家,特征量化,可用性评估等流程,就基本划定了特征范围

3. 剧情二:“特征预处理”的门道

李雷说完,便拿出自己的平板,给韩梅梅看自己某个项目中搜集的初始特征。这些特征被放在一张巨大的表里。

韩梅梅看着这些密密麻麻的数字,心想:看李雷说得头头是道,但还是没告诉我怎么挑,不能让他轻易绕过去。

于是她说:“我看你这些特征数据有大有小,有些就是几万上下浮动,有些仅仅是小数点后好几位的微小变化,有些就是在0或1这两种可能中变化,有些连值都没有。你这些数据能用吗?”

李雷说:“不能,要转换成标准件。”

韩梅梅:“标准件?”

4. “特征标准件”

如果把机器学习过程当做一个加工厂的话,那输入的数据(特征、标签)就是原材料,输出的模型和判断结果就是产品。并不是胡乱扔进去任何原材料都能加工出合格产品的。原材料需要一个“预处理”过程才能方便地被算法处理。这些预处理后的数据,李雷起了个不够规范的名字,叫做“特征标准件”

以二分类问题为例,不同的算法对“特征标准件”的要求是不同的。比如逻辑回归和神经网络,比较喜欢归一化之后在[-1,1]区间内浮动的特征。而贝叶斯方法,喜欢因子化之后的{0,1}分布的二元特征,每个特征只有“是”和“不是”两种可能的状态。

5. 连续特征与非连续特征

特征可以分为两类:“连续特征”和“非连续特征”。

“身高”、“体重”、“成绩”、“腰围”、“长度”、“宽度”、“体积”、“速度”等等,都是连续特征。连续特征能够比较方便地进行归一化。归一化的统一公式如下:

<nobr><span class="math" id="MathJax-Span-1" style="width: 4.749em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.789em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.549em 1000em 3.096em -0.531em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-2"><span class="msubsup" id="MathJax-Span-3"><span style="display: inline-block; position: relative; width: 0.963em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-4" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.771em; left: 0.536em;"><span class="mo" id="MathJax-Span-5" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">∗</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-6" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mfrac" id="MathJax-Span-7" style="padding-left: 0.323em;"><span style="display: inline-block; position: relative; width: 1.283em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.923em 1000em 2.723em -0.477em); top: -2.931em; left: 50%; margin-left: -0.584em;"><span class="mrow" id="MathJax-Span-8"><span class="mi" id="MathJax-Span-9" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mo" id="MathJax-Span-10" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">−</span><span class="mi" id="MathJax-Span-11" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.024em; left: 50%; margin-left: -0.157em;"><span class="mi" id="MathJax-Span-12" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">S<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 1.283em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.737em; vertical-align: -0.53em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-1">x^* = \frac{x-\mu}{S}</script>
<nobr><span class="math" id="MathJax-Span-13" style="width: 0.696em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.536em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.976em 1000em 2.936em -0.531em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-14"><span class="mi" id="MathJax-Span-15" style="font-family: STIXGeneral-Italic;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 0.937em; vertical-align: -0.33em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-2">\mu</script>为所有样本数据的均值,<nobr><span class="math" id="MathJax-Span-16" style="width: 2.829em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.243em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.976em 1000em 2.936em -0.531em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-17"><span class="mi" id="MathJax-Span-18" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mo" id="MathJax-Span-19" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">−</span><span class="mi" id="MathJax-Span-20" style="font-family: STIXGeneral-Italic; padding-left: 0.269em;">μ</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 0.937em; vertical-align: -0.33em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-3">x-\mu</script>的步骤叫做去均值化

  1. <nobr><span class="math" id="MathJax-Span-21" style="width: 8.109em; display: inline-block;"><span style="display: inline-block; position: relative; width: 6.456em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.709em 1000em 2.883em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-22"><span class="mi" id="MathJax-Span-23" style="font-family: STIXGeneral-Italic;">S<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mo" id="MathJax-Span-24" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="msubsup" id="MathJax-Span-25" style="padding-left: 0.323em;"><span style="display: inline-block; position: relative; width: 1.763em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-26" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.483em;"><span class="texatom" id="MathJax-Span-27"><span class="mrow" id="MathJax-Span-28"><span class="mi" id="MathJax-Span-29" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">m</span><span class="mi" id="MathJax-Span-30" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">a</span><span class="mi" id="MathJax-Span-31" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-32" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">−</span><span class="msubsup" id="MathJax-Span-33" style="padding-left: 0.269em;"><span style="display: inline-block; position: relative; width: 1.603em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-34" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.483em;"><span class="texatom" id="MathJax-Span-35"><span class="mrow" id="MathJax-Span-36"><span class="mi" id="MathJax-Span-37" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">m</span><span class="mi" id="MathJax-Span-38" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">i</span><span class="mi" id="MathJax-Span-39" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">n</span></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.137em; vertical-align: -0.263em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-4">S = x_{max}-x_{min} </script>时,经过处理的数据在区间[-1,1]之间。
  2. <nobr><span class="math" id="MathJax-Span-40" style="width: 13.016em; display: inline-block;"><span style="display: inline-block; position: relative; width: 10.403em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.603em 1000em 2.936em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-41"><span class="mi" id="MathJax-Span-42" style="font-family: STIXGeneral-Italic;">S<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mo" id="MathJax-Span-43" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mi" id="MathJax-Span-44" style="font-family: STIXGeneral-Italic; padding-left: 0.323em;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="texatom" id="MathJax-Span-45"><span class="mrow" id="MathJax-Span-46"><span class="mo" id="MathJax-Span-47"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">(</span></span></span></span><span class="texatom" id="MathJax-Span-48"><span class="mrow" id="MathJax-Span-49"><span class="mo" id="MathJax-Span-50"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">所</span></span></span></span><span class="texatom" id="MathJax-Span-51"><span class="mrow" id="MathJax-Span-52"><span class="mo" id="MathJax-Span-53"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">有</span></span></span></span><span class="texatom" id="MathJax-Span-54"><span class="mrow" id="MathJax-Span-55"><span class="mo" id="MathJax-Span-56"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">样</span></span></span></span><span class="texatom" id="MathJax-Span-57"><span class="mrow" id="MathJax-Span-58"><span class="mo" id="MathJax-Span-59"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">本</span></span></span></span><span class="texatom" id="MathJax-Span-60"><span class="mrow" id="MathJax-Span-61"><span class="mo" id="MathJax-Span-62"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">的</span></span></span></span><span class="texatom" id="MathJax-Span-63"><span class="mrow" id="MathJax-Span-64"><span class="mo" id="MathJax-Span-65"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">标</span></span></span></span><span class="texatom" id="MathJax-Span-66"><span class="mrow" id="MathJax-Span-67"><span class="mo" id="MathJax-Span-68"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">准</span></span></span></span><span class="texatom" id="MathJax-Span-69"><span class="mrow" id="MathJax-Span-70"><span class="mo" id="MathJax-Span-71"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">差</span></span></span></span><span class="texatom" id="MathJax-Span-72"><span class="mrow" id="MathJax-Span-73"><span class="mo" id="MathJax-Span-74"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">)</span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.403em; vertical-align: -0.33em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-5">S = \sigma(所有样本的标准差)</script>时,经过处理的数据符合标准正态分布,即均值为0,标准差为1

另一方面:“是否高富帅”、“是否白富美”、“螃蟹的品种”、“螃蟹所在的水域”、“收获螃蟹的季节”等等,都是非连续特征。非连续特征能够比较方便地进行因子化,或者它本身就是二元特征。方法如下:

特征“收获螃蟹的季节”:{春,夏,秋,冬} 因子化后的结果为:

  • 特征“是否春”:{是,否}
  • 特征“是否夏”:{是,否}
  • 特征“是否秋”:{是,否}
  • 特征“是否冬”:{是,否}

6. 两类特征的相互转化

连续特征可以当非连续特征来用,非连续特征可以当连续特征来用

连续特征可以离散化非连续特征。比如“年龄”作为一个连续特征,假设它的取值范围是[0,100]。我们可以中间切一刀,比如选择60(岁)。大于等于60岁的就叫做“老年”,小于60岁的就是“非老年”,这样就转化成了一个二元特征了。怎么选择离散的分离边界也很有学问

如果我们中间切两刀甚至更多刀,比如18(岁)和60(岁)。大于等于60岁的就叫做“老年”,18岁到60岁之间的就叫做“中青年”,小于18岁就叫做“未成年”。然后再把这3类因子化成3个二分类就够了:“是否老年”、“是否中青年”和“是否未成年”。

等宽直方图

非连续特征因子化成二元特征{0,1}后可以直接当做[0,1]之间的连续特征来用。我们之前文章《机器学习系列(3)_逻辑回归应用之Kaggle泰坦尼克之灾》就是这么使用的。

7. 去除特征之间的共线性

我们在对离散特征因子化过程中细分到二元特征为止即可。那对于二元特征本身能否因子化成两个特征?比如以下例子:

特征“螃蟹的性别”:{公,母} ,可否转换为:

  • 特征“是否公螃蟹”:{是,否}
  • 特征“是否母螃蟹”:{是,否}

这是不行的,因为这两个特征的信息完全一样,也叫做共线性。计算这两个特征之间的条件熵

<nobr><span class="math" id="MathJax-Span-75" style="width: 16.643em; display: inline-block;"><span style="display: inline-block; position: relative; width: 13.283em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.603em 1000em 2.936em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-76"><span class="mi" id="MathJax-Span-77" style="font-family: STIXGeneral-Italic;">H<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-78" style="font-family: STIXGeneral-Regular;">(</span><span class="mo" id="MathJax-Span-79" style="font-family: STIXGeneral-Regular;">“</span><span class="texatom" id="MathJax-Span-80"><span class="mrow" id="MathJax-Span-81"><span class="mo" id="MathJax-Span-82"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">是</span></span></span></span><span class="texatom" id="MathJax-Span-83"><span class="mrow" id="MathJax-Span-84"><span class="mo" id="MathJax-Span-85"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">否</span></span></span></span><span class="texatom" id="MathJax-Span-86"><span class="mrow" id="MathJax-Span-87"><span class="mo" id="MathJax-Span-88"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">公</span></span></span></span><span class="texatom" id="MathJax-Span-89"><span class="mrow" id="MathJax-Span-90"><span class="mo" id="MathJax-Span-91"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">螃</span></span></span></span><span class="texatom" id="MathJax-Span-92"><span class="mrow" id="MathJax-Span-93"><span class="mo" id="MathJax-Span-94"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">蟹</span></span></span></span><span class="mo" id="MathJax-Span-95" style="font-family: STIXGeneral-Regular;">”</span><span class="texatom" id="MathJax-Span-96"><span class="mrow" id="MathJax-Span-97"><span class="mo" id="MathJax-Span-98" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="mo" id="MathJax-Span-99" style="font-family: STIXGeneral-Regular;">“</span><span class="texatom" id="MathJax-Span-100"><span class="mrow" id="MathJax-Span-101"><span class="mo" id="MathJax-Span-102"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">是</span></span></span></span><span class="texatom" id="MathJax-Span-103"><span class="mrow" id="MathJax-Span-104"><span class="mo" id="MathJax-Span-105"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">否</span></span></span></span><span class="texatom" id="MathJax-Span-106"><span class="mrow" id="MathJax-Span-107"><span class="mo" id="MathJax-Span-108"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">母</span></span></span></span><span class="texatom" id="MathJax-Span-109"><span class="mrow" id="MathJax-Span-110"><span class="mo" id="MathJax-Span-111"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">螃</span></span></span></span><span class="texatom" id="MathJax-Span-112"><span class="mrow" id="MathJax-Span-113"><span class="mo" id="MathJax-Span-114"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">蟹</span></span></span></span><span class="mo" id="MathJax-Span-115" style="font-family: STIXGeneral-Regular;">”</span><span class="mo" id="MathJax-Span-116" style="font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-117" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mn" id="MathJax-Span-118" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">0</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.403em; vertical-align: -0.33em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-6">H(“是否公螃蟹”|“是否母螃蟹”)=0</script>

也可以用计算条件熵的方法去衡量两类离散特征的差异性,方便去除共线性关系的特征

连续特征也有着共线性的情况,比如同一个品种的螃蟹腿的“长度”和“粗细”是共线性关系。也就是说,如果我们知道螃蟹腿的长度是<nobr><span class="math" id="MathJax-Span-119" style="width: 0.643em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.483em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-120"><span class="mi" id="MathJax-Span-121" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 0.67em; vertical-align: -0.063em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-7">x</script>厘米,那么螃蟹腿的直径就是<nobr><span class="math" id="MathJax-Span-122" style="width: 1.176em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.709em 1000em 2.723em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-123"><span class="mi" id="MathJax-Span-124" style="font-family: STIXGeneral-Italic;">k<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-125" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.003em; vertical-align: -0.063em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-8">kx</script>厘米,<nobr><span class="math" id="MathJax-Span-126" style="width: 0.643em; display: inline-block;"><span style="display: inline-block; position: relative; width: 0.483em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.709em 1000em 2.723em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-127"><span class="mi" id="MathJax-Span-128" style="font-family: STIXGeneral-Italic;">k<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.003em; vertical-align: -0.063em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-9">k</script>是一个稳定的常数。因此我们只需要螃蟹腿的“长度”这一个特征就够了。那么连续特征的共线性如何去除?

可以计算两个变量<nobr><span class="math" id="MathJax-Span-129" style="width: 2.563em; display: inline-block;"><span style="display: inline-block; position: relative; width: 2.029em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.709em 1000em 2.936em -0.424em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-130"><span class="mo" id="MathJax-Span-131" style="font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-132" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mo" id="MathJax-Span-133" style="font-family: STIXGeneral-Regular;">,</span><span class="mi" id="MathJax-Span-134" style="font-family: STIXGeneral-Italic; padding-left: 0.216em;">y</span><span class="mo" id="MathJax-Span-135" style="font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.27em; vertical-align: -0.33em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-10">(x,y)</script>的相关系数

<nobr><span class="math" id="MathJax-Span-136" style="width: 15.469em; display: inline-block;"><span style="display: inline-block; position: relative; width: 12.376em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.389em 1000em 3.523em -0.424em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-137"><span class="msubsup" id="MathJax-Span-138"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.424em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-139" style="font-family: STIXGeneral-Italic;">r<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="texatom" id="MathJax-Span-140"><span class="mrow" id="MathJax-Span-141"><span class="mi" id="MathJax-Span-142" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-143" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">y</span></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-144" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mfrac" id="MathJax-Span-145" style="padding-left: 0.323em;"><span style="display: inline-block; position: relative; width: 2.403em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.477em); top: -2.931em; left: 50%; margin-left: -1.117em;"><span class="mrow" id="MathJax-Span-146"><span class="mi" id="MathJax-Span-147" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">c</span><span class="mi" id="MathJax-Span-148" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-149" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">v</span><span class="mo" id="MathJax-Span-150" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-151" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mo" id="MathJax-Span-152" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="mi" id="MathJax-Span-153" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">y</span><span class="mo" id="MathJax-Span-154" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(3.523em 1000em 4.376em -0.477em); top: -3.677em; left: 50%; margin-left: -0.744em;"><span class="mrow" id="MathJax-Span-155"><span class="msubsup" id="MathJax-Span-156"><span style="display: inline-block; position: relative; width: 0.749em; height: 0px;"><span style="position: absolute; clip: rect(1.923em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-157" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.376em;"><span class="mi" id="MathJax-Span-158" style="font-size: 50%; font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-159"><span style="display: inline-block; position: relative; width: 0.749em; height: 0px;"><span style="position: absolute; clip: rect(1.923em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-160" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">σ<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.376em;"><span class="mi" id="MathJax-Span-161" style="font-size: 50%; font-family: STIXGeneral-Italic;">y</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 2.403em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span><span class="mo" id="MathJax-Span-162" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mfrac" id="MathJax-Span-163" style="padding-left: 0.323em;"><span style="display: inline-block; position: relative; width: 5.763em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.477em); top: -2.931em; left: 50%; margin-left: -1.117em;"><span class="mrow" id="MathJax-Span-164"><span class="mi" id="MathJax-Span-165" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">c</span><span class="mi" id="MathJax-Span-166" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-167" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">v</span><span class="mo" id="MathJax-Span-168" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-169" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mo" id="MathJax-Span-170" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="mi" id="MathJax-Span-171" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">y</span><span class="mo" id="MathJax-Span-172" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(3.256em 1000em 4.429em -0.424em); top: -3.517em; left: 50%; margin-left: -2.824em;"><span class="msqrt" id="MathJax-Span-173"><span style="display: inline-block; position: relative; width: 5.656em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.477em); top: -2.397em; left: 0.643em;"><span class="mrow" id="MathJax-Span-174"><span class="mi" id="MathJax-Span-175" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">c</span><span class="mi" id="MathJax-Span-176" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-177" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">v</span><span class="mo" id="MathJax-Span-178" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-179" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mo" id="MathJax-Span-180" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="mi" id="MathJax-Span-181" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mo" id="MathJax-Span-182" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-183" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">×</span><span class="mi" id="MathJax-Span-184" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">c</span><span class="mi" id="MathJax-Span-185" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-186" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">v</span><span class="mo" id="MathJax-Span-187" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-188" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">y</span><span class="mo" id="MathJax-Span-189" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="mi" id="MathJax-Span-190" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">y</span><span class="mo" id="MathJax-Span-191" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.909em 1000em 1.283em -0.477em); top: -1.651em; left: 0.643em;"><span style="border-left-width: 5.016em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: -0.051em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span><span style="position: absolute; clip: rect(3.149em 1000em 4.323em -0.424em); top: -3.891em; left: 0.003em;"><span><span style="font-size: 70.7%; font-family: STIXGeneral-Regular;">√</span></span><span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 5.763em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 2.403em; vertical-align: -1.063em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-11">r_{xy}=\frac{cov(x,y)}{\sigma_x \sigma_y}=\frac{cov(x,y)}{\sqrt{cov(x,x)×cov(y,y)}}</script>
<nobr><span class="math" id="MathJax-Span-192" style="width: 1.553em; display: inline-block;"><span style="display: inline-block; position: relative; width: 1.191em; height: 0px; font-size: 129%;"><span style="position: absolute; clip: rect(1.656em 1000em 2.742em -0.411em); top: -2.271em; left: 0.003em;"><span class="mrow" id="MathJax-Span-193"><span class="msubsup" id="MathJax-Span-194"><span style="display: inline-block; position: relative; width: 1.14em; height: 0px;"><span style="position: absolute; clip: rect(1.863em 1000em 2.638em -0.411em); top: -2.478em; left: 0.003em;"><span class="mi" id="MathJax-Span-195" style="font-family: STIXGeneral-Italic;">r<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.483em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.416em;"><span class="texatom" id="MathJax-Span-196"><span class="mrow" id="MathJax-Span-197"><span class="mi" id="MathJax-Span-198" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-199" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">y</span></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.276em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.07em; vertical-align: -0.463em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-12">r_{xy}</script>的取值范围是[-1,1],如果是0则统计独立,如果接近1则强相关。

可以计算这些数据的协方差矩阵,进而求出相关系数矩阵。就可以比较任意两个特征了。

协方差矩阵
相关系数矩阵

既然协方差矩阵都求了,那就干脆用主成分分析(PCA)吧,这样更省事。得到主成分,线性相关的那些量就直接被舍弃了。我们在前文《深度学习与计算机视觉系列(7)_神经网络数据预处理,正则化与损失函数》 对PCA有相关论述。

感兴趣的同学可以试试把上述离散二元特征当做连续变量使用,构造几个数据,计算其相关系数并进行主成分分析。发现其相关系数就是-1,主成分分析后自动就变成一个主成分了。可见PCA对于连续特征与非连续特征都是去除共线性的通用方法

8. 缺失值的处理

这个问题现在才讲,但实际过程中应该在前期去处理。掌握以下三点就够了:

  1. 如果某个特征的缺失值比较多:可能就直接舍弃。
  2. 如果缺失值不是很多,而且是连续特征:可以考虑用回归方法去拟合,或者直接用众数、中位数、平均数等具体的值去替代即可。
  3. 如果缺失值不是很多,而且是非连续特征:可以尝试把缺失值当做一个新的类目去处理,可能也揭示了一定的客观现实。

9. 离群点的分析

对于连续特征,最好看看其在样本中的分布。如果某些值偏离了主要聚集区域,可能需要单独抽出来分析,里面可能包含了更多的信息,可以这样画图方便观察:

离群点

10. 特征预处理小结

特征的预处理步骤比较多,相互之间的关系比较复杂。我们画了一张图以揭示它们之间的关系:

特征预处理

11. 剧情三:李雷另辟蹊径挑螃蟹

韩梅梅长叹一口气:“终于听你叨逼叨逼说完了。”

李雷说:“没办法啊,这块工作其实挺多的。我还要好多没说完……” “你打住”,韩梅梅赶紧说,“我算服了你了。但是李大码农,你还没有跟我说你怎么靠这些特征挑螃蟹呢。”

李雷说:“不急,用逻辑回归……”韩梅梅说:“不要用逻辑回归,我已经从赵媒婆那知道了。你换个方法,用非连续特征来做。”韩梅梅存心想刁难她的相亲对象。

李雷说:“那可以用贝叶斯。”

12. 用贝叶斯方法挑螃蟹

我们的标签用<nobr><span class="math" id="MathJax-Span-200" style="width: 6.563em; display: inline-block;"><span style="display: inline-block; position: relative; width: 5.229em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.603em 1000em 2.936em -0.424em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-201"><span class="mi" id="MathJax-Span-202" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-203" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mo" id="MathJax-Span-204" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">“</span><span class="texatom" id="MathJax-Span-205"><span class="mrow" id="MathJax-Span-206"><span class="mo" id="MathJax-Span-207"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">是</span></span></span></span><span class="texatom" id="MathJax-Span-208"><span class="mrow" id="MathJax-Span-209"><span class="mo" id="MathJax-Span-210"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">满</span></span></span></span><span class="texatom" id="MathJax-Span-211"><span class="mrow" id="MathJax-Span-212"><span class="mo" id="MathJax-Span-213"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">黄</span></span></span></span><span class="mo" id="MathJax-Span-214" style="font-family: STIXGeneral-Regular;">”</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.403em; vertical-align: -0.33em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-13">Y=“是满黄”</script>来表示,相应的<nobr><span class="math" id="MathJax-Span-215" style="width: 7.736em; display: inline-block;"><span style="display: inline-block; position: relative; width: 6.189em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.336em 1000em 2.936em -0.424em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-216"><span class="munderover" id="MathJax-Span-217"><span style="display: inline-block; position: relative; width: 0.749em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.424em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-218" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -3.197em; left: 0.056em;"><span class="mo" id="MathJax-Span-219" style=""><span style="display: inline-block; position: relative; width: 0.643em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.376em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="font-family: STIXGeneral-Regular; position: absolute; top: -3.997em; left: 0.163em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-220" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mo" id="MathJax-Span-221" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">“</span><span class="texatom" id="MathJax-Span-222"><span class="mrow" id="MathJax-Span-223"><span class="mo" id="MathJax-Span-224"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">不</span></span></span></span><span class="texatom" id="MathJax-Span-225"><span class="mrow" id="MathJax-Span-226"><span class="mo" id="MathJax-Span-227"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">是</span></span></span></span><span class="texatom" id="MathJax-Span-228"><span class="mrow" id="MathJax-Span-229"><span class="mo" id="MathJax-Span-230"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">满</span></span></span></span><span class="texatom" id="MathJax-Span-231"><span class="mrow" id="MathJax-Span-232"><span class="mo" id="MathJax-Span-233"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">黄</span></span></span></span><span class="mo" id="MathJax-Span-234" style="font-family: STIXGeneral-Regular;">”</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.67em; vertical-align: -0.33em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-14">\overline{Y}=“不是满黄”</script>。Xi表示所有离散化的二元特征,如<nobr><span class="math" id="MathJax-Span-235" style="width: 31.203em; display: inline-block;"><span style="display: inline-block; position: relative; width: 24.963em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.603em 1000em 2.936em -0.531em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-236"><span class="msubsup" id="MathJax-Span-237"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-238" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-239" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-240" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mo" id="MathJax-Span-241" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">“</span><span class="texatom" id="MathJax-Span-242"><span class="mrow" id="MathJax-Span-243"><span class="mo" id="MathJax-Span-244"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">是</span></span></span></span><span class="texatom" id="MathJax-Span-245"><span class="mrow" id="MathJax-Span-246"><span class="mo" id="MathJax-Span-247"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">河</span></span></span></span><span class="texatom" id="MathJax-Span-248"><span class="mrow" id="MathJax-Span-249"><span class="mo" id="MathJax-Span-250"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">蟹</span></span></span></span><span class="mo" id="MathJax-Span-251" style="font-family: STIXGeneral-Regular;">”</span><span class="texatom" id="MathJax-Span-252"><span class="mrow" id="MathJax-Span-253"><span class="mo" id="MathJax-Span-254"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">,</span></span></span></span><span class="msubsup" id="MathJax-Span-255"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-256" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-257" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-258" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mo" id="MathJax-Span-259" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">“</span><span class="texatom" id="MathJax-Span-260"><span class="mrow" id="MathJax-Span-261"><span class="mo" id="MathJax-Span-262"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">是</span></span></span></span><span class="texatom" id="MathJax-Span-263"><span class="mrow" id="MathJax-Span-264"><span class="mo" id="MathJax-Span-265"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">秋</span></span></span></span><span class="texatom" id="MathJax-Span-266"><span class="mrow" id="MathJax-Span-267"><span class="mo" id="MathJax-Span-268"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">季</span></span></span></span><span class="texatom" id="MathJax-Span-269"><span class="mrow" id="MathJax-Span-270"><span class="mo" id="MathJax-Span-271"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">收</span></span></span></span><span class="texatom" id="MathJax-Span-272"><span class="mrow" id="MathJax-Span-273"><span class="mo" id="MathJax-Span-274"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">货</span></span></span></span><span class="mo" id="MathJax-Span-275" style="font-family: STIXGeneral-Regular;">”</span><span class="texatom" id="MathJax-Span-276"><span class="mrow" id="MathJax-Span-277"><span class="mo" id="MathJax-Span-278"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">,</span></span></span></span><span class="msubsup" id="MathJax-Span-279"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-280" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-281" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-282" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mo" id="MathJax-Span-283" style="font-family: STIXGeneral-Regular;">”</span><span class="texatom" id="MathJax-Span-284"><span class="mrow" id="MathJax-Span-285"><span class="mo" id="MathJax-Span-286"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">钳</span></span></span></span><span class="texatom" id="MathJax-Span-287"><span class="mrow" id="MathJax-Span-288"><span class="mo" id="MathJax-Span-289"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">子</span></span></span></span><span class="texatom" id="MathJax-Span-290"><span class="mrow" id="MathJax-Span-291"><span class="mo" id="MathJax-Span-292"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">的</span></span></span></span><span class="texatom" id="MathJax-Span-293"><span class="mrow" id="MathJax-Span-294"><span class="mo" id="MathJax-Span-295"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">力</span></span></span></span><span class="texatom" id="MathJax-Span-296"><span class="mrow" id="MathJax-Span-297"><span class="mo" id="MathJax-Span-298"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">量</span></span></span></span><span class="texatom" id="MathJax-Span-299"><span class="mrow" id="MathJax-Span-300"><span class="mo" id="MathJax-Span-301"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">大</span></span></span></span><span class="mo" id="MathJax-Span-302" style="font-family: STIXGeneral-Regular;">”</span><span class="mo" id="MathJax-Span-303" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">…</span><span class="mo" id="MathJax-Span-304" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">…</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.403em; vertical-align: -0.33em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-15">X_1=“是河蟹”,X_2=“是秋季收货”,X_3=”钳子的力量大”……</script>。于是在已知这些特征的情况下,该螃蟹“是满黄”的概率如下:

<nobr><span class="math" id="MathJax-Span-305" style="width: 20.003em; display: inline-block;"><span style="display: inline-block; position: relative; width: 16.003em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.389em 1000em 3.256em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-306"><span class="mi" id="MathJax-Span-307" style="font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-308" style="font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-309" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="texatom" id="MathJax-Span-310"><span class="mrow" id="MathJax-Span-311"><span class="mo" id="MathJax-Span-312" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-313"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-314" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-315" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-316" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-317" style="padding-left: 0.216em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-318" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-319" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-320" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-321" style="padding-left: 0.216em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-322" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-323" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-324" style="font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-325" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-326" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-327" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">)</span><span class="mo" id="MathJax-Span-328" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mfrac" id="MathJax-Span-329" style="padding-left: 0.323em;"><span style="display: inline-block; position: relative; width: 6.669em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -3.251em;"><span class="mrow" id="MathJax-Span-330"><span class="mi" id="MathJax-Span-331" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-332" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-333"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-334" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-335" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-336" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-337"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-338" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-339" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-340" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-341"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-342" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-343" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-344" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-345" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-346" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="texatom" id="MathJax-Span-347"><span class="mrow" id="MathJax-Span-348"><span class="mo" id="MathJax-Span-349" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-350" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-351" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-352" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">×</span><span class="mi" id="MathJax-Span-353" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-354" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-355" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-356" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.024em; left: 50%; margin-left: -2.077em;"><span class="mrow" id="MathJax-Span-357"><span class="mi" id="MathJax-Span-358" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-359" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-360"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-361" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-362" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-363" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-364"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-365" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-366" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-367" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-368"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-369" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-370" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-371" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-372" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-373" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-374" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 6.669em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 2.07em; vertical-align: -0.73em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-16">P(Y|X_1,X_2,X_3...)=\frac{P(X_1,X_2,X_3...|Y)×P(Y)}{P(X_1,X_2,X_3...)}</script>

其实,可以直接判断<nobr><span class="math" id="MathJax-Span-375" style="width: 9.873em; display: inline-block;"><span style="display: inline-block; position: relative; width: 7.651em; height: 0px; font-size: 129%;"><span style="position: absolute; clip: rect(1.656em 1000em 2.793em -0.463em); top: -2.478em; left: 0.003em;"><span class="mrow" id="MathJax-Span-376"><span class="mi" id="MathJax-Span-377" style="font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-378" style="font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-379" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span class="texatom" id="MathJax-Span-380"><span class="mrow" id="MathJax-Span-381"><span class="mo" id="MathJax-Span-382" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-383"><span style="display: inline-block; position: relative; width: 1.088em; height: 0px;"><span style="position: absolute; clip: rect(1.656em 1000em 2.638em -0.514em); top: -2.478em; left: 0.003em;"><span class="mi" id="MathJax-Span-384" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.483em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.623em;"><span class="mn" id="MathJax-Span-385" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span></span></span><span class="mo" id="MathJax-Span-386" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-387" style="padding-left: 0.209em;"><span style="display: inline-block; position: relative; width: 1.088em; height: 0px;"><span style="position: absolute; clip: rect(1.656em 1000em 2.638em -0.514em); top: -2.478em; left: 0.003em;"><span class="mi" id="MathJax-Span-388" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.483em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.623em;"><span class="mn" id="MathJax-Span-389" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span></span></span><span class="mo" id="MathJax-Span-390" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-391" style="padding-left: 0.209em;"><span style="display: inline-block; position: relative; width: 1.088em; height: 0px;"><span style="position: absolute; clip: rect(1.656em 1000em 2.638em -0.514em); top: -2.478em; left: 0.003em;"><span class="mi" id="MathJax-Span-392" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.483em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.623em;"><span class="mn" id="MathJax-Span-393" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span></span></span><span class="mo" id="MathJax-Span-394" style="font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-395" style="font-family: STIXGeneral-Regular; padding-left: 0.209em;">.</span><span class="mo" id="MathJax-Span-396" style="font-family: STIXGeneral-Regular; padding-left: 0.209em;">.</span><span class="mo" id="MathJax-Span-397" style="font-family: STIXGeneral-Regular; padding-left: 0.209em;">)</span></span><span style="display: inline-block; width: 0px; height: 2.483em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.27em; vertical-align: -0.263em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-17">P(Y|X_1,X_2,X_3...)</script>是否大于1/2即可。因为<nobr><span class="math" id="MathJax-Span-398" style="width: 8.749em; display: inline-block;"><span style="display: inline-block; position: relative; width: 6.989em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.709em 1000em 2.883em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-399"><span class="mi" id="MathJax-Span-400" style="font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-401" style="font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-402"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-403" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-404" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-405" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-406" style="padding-left: 0.216em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-407" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-408" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-409" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-410" style="padding-left: 0.216em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-411" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-412" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-413" style="font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-414" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-415" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-416" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">)</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.203em; vertical-align: -0.263em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-18">P(X_1,X_2,X_3...)</script>这一项算起来比较麻烦,我们用以下方法直接把它约掉。

先求出螃蟹“不是满黄”的概率:

<nobr><span class="math" id="MathJax-Span-417" style="width: 20.643em; display: inline-block;"><span style="display: inline-block; position: relative; width: 16.483em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.123em 1000em 3.256em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-418"><span class="mi" id="MathJax-Span-419" style="font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-420" style="font-family: STIXGeneral-Regular;">(</span><span class="munderover" id="MathJax-Span-421"><span style="display: inline-block; position: relative; width: 0.749em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.424em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-422" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -3.197em; left: 0.056em;"><span class="mo" id="MathJax-Span-423" style=""><span style="display: inline-block; position: relative; width: 0.643em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.376em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="font-family: STIXGeneral-Regular; position: absolute; top: -3.997em; left: 0.163em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="texatom" id="MathJax-Span-424"><span class="mrow" id="MathJax-Span-425"><span class="mo" id="MathJax-Span-426" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-427"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-428" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-429" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-430" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-431" style="padding-left: 0.216em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-432" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-433" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-434" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-435" style="padding-left: 0.216em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-436" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-437" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-438" style="font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-439" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-440" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-441" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">)</span><span class="mo" id="MathJax-Span-442" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mfrac" id="MathJax-Span-443" style="padding-left: 0.323em;"><span style="display: inline-block; position: relative; width: 6.989em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -3.411em;"><span class="mrow" id="MathJax-Span-444"><span class="mi" id="MathJax-Span-445" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-446" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-447"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-448" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-449" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-450" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-451"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-452" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-453" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-454" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-455"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-456" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-457" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-458" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-459" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-460" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="texatom" id="MathJax-Span-461"><span class="mrow" id="MathJax-Span-462"><span class="mo" id="MathJax-Span-463" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-464"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-465" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-466" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-467" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-468" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">×</span><span class="mi" id="MathJax-Span-469" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-470" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="munderover" id="MathJax-Span-471"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-472" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-473" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-474" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.024em; left: 50%; margin-left: -2.077em;"><span class="mrow" id="MathJax-Span-475"><span class="mi" id="MathJax-Span-476" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-477" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-478"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-479" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-480" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-481" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-482"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-483" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-484" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-485" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-486"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-487" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-488" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-489" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-490" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-491" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-492" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 6.989em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 2.403em; vertical-align: -0.73em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-19">P(\overline{Y}|X_1,X_2,X_3...)=\frac{P(X_1,X_2,X_3...|\overline{Y})×P(\overline{Y})}{P(X_1,X_2,X_3...)}</script>

再两式相处,得到:

<nobr><span class="math" id="MathJax-Span-493" style="width: 17.336em; display: inline-block;"><span style="display: inline-block; position: relative; width: 13.869em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.389em 1000em 3.523em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-494"><span class="mfrac" id="MathJax-Span-495"><span style="display: inline-block; position: relative; width: 5.069em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -2.397em;"><span class="mrow" id="MathJax-Span-496"><span class="mi" id="MathJax-Span-497" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-498" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-499" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="texatom" id="MathJax-Span-500"><span class="mrow" id="MathJax-Span-501"><span class="mo" id="MathJax-Span-502" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-503"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-504" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-505" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-506" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-507"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-508" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-509" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-510" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-511"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-512" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-513" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-514" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-515" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-516" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-517" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -2.451em;"><span class="mrow" id="MathJax-Span-518"><span class="mi" id="MathJax-Span-519" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-520" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="munderover" id="MathJax-Span-521"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-522" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-523" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="texatom" id="MathJax-Span-524"><span class="mrow" id="MathJax-Span-525"><span class="mo" id="MathJax-Span-526" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-527"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-528" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-529" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-530" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-531"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-532" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-533" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-534" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-535"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-536" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-537" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-538" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-539" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-540" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-541" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 5.069em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span><span class="mo" id="MathJax-Span-542" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mfrac" id="MathJax-Span-543" style="padding-left: 0.323em;"><span style="display: inline-block; position: relative; width: 6.989em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -3.251em;"><span class="mrow" id="MathJax-Span-544"><span class="mi" id="MathJax-Span-545" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-546" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-547"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-548" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-549" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-550" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-551"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-552" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-553" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-554" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-555"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-556" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-557" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-558" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-559" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-560" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="texatom" id="MathJax-Span-561"><span class="mrow" id="MathJax-Span-562"><span class="mo" id="MathJax-Span-563" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-564" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-565" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-566" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">×</span><span class="mi" id="MathJax-Span-567" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-568" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-569" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-570" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -3.411em;"><span class="mrow" id="MathJax-Span-571"><span class="mi" id="MathJax-Span-572" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-573" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-574"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-575" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-576" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-577" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-578"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-579" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-580" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-581" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-582"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-583" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-584" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-585" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-586" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-587" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="texatom" id="MathJax-Span-588"><span class="mrow" id="MathJax-Span-589"><span class="mo" id="MathJax-Span-590" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-591"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-592" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-593" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-594" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-595" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">×</span><span class="mi" id="MathJax-Span-596" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-597" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="munderover" id="MathJax-Span-598"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-599" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-600" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-601" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 6.989em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 2.403em; vertical-align: -1.063em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-20">\frac{P(Y|X_1,X_2,X_3...)}{P(\overline{Y}|X_1,X_2,X_3...)}=\frac{P(X_1,X_2,X_3...|Y)×P(Y)}{P(X_1,X_2,X_3...|\overline{Y})×P(\overline{Y})}</script>

这样就约去了P(X1,X2,X3…)。只需要判断<nobr><span class="math" id="MathJax-Span-602" style="width: 6.928em; display: inline-block;"><span style="display: inline-block; position: relative; width: 5.377em; height: 0px; font-size: 129%;"><span style="position: absolute; clip: rect(1.088em 1000em 3.207em -0.463em); top: -2.271em; left: 0.003em;"><span class="mrow" id="MathJax-Span-603"><span class="mfrac" id="MathJax-Span-604"><span style="display: inline-block; position: relative; width: 5.119em; height: 0px; margin-right: 0.106em; margin-left: 0.106em;"><span style="position: absolute; clip: rect(1.708em 1000em 2.587em -0.463em); top: -2.84em; left: 50%; margin-left: -2.426em;"><span class="mrow" id="MathJax-Span-605"><span class="mi" id="MathJax-Span-606" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-607" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-608" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span class="texatom" id="MathJax-Span-609"><span class="mrow" id="MathJax-Span-610"><span class="mo" id="MathJax-Span-611" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-612"><span style="display: inline-block; position: relative; width: 0.829em; height: 0px;"><span style="position: absolute; clip: rect(1.708em 1000em 2.483em -0.463em); top: -2.323em; left: 0.003em;"><span class="mi" id="MathJax-Span-613" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.468em;"><span class="mn" id="MathJax-Span-614" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.276em;"></span></span></span></span><span class="mo" id="MathJax-Span-615" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-616"><span style="display: inline-block; position: relative; width: 0.829em; height: 0px;"><span style="position: absolute; clip: rect(1.708em 1000em 2.483em -0.463em); top: -2.323em; left: 0.003em;"><span class="mi" id="MathJax-Span-617" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.468em;"><span class="mn" id="MathJax-Span-618" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.276em;"></span></span></span></span><span class="mo" id="MathJax-Span-619" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-620"><span style="display: inline-block; position: relative; width: 0.829em; height: 0px;"><span style="position: absolute; clip: rect(1.708em 1000em 2.483em -0.463em); top: -2.323em; left: 0.003em;"><span class="mi" id="MathJax-Span-621" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.468em;"><span class="mn" id="MathJax-Span-622" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.276em;"></span></span></span></span><span class="mo" id="MathJax-Span-623" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-624" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-625" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-626" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; clip: rect(1.398em 1000em 2.587em -0.463em); top: -1.651em; left: 50%; margin-left: -2.478em;"><span class="mrow" id="MathJax-Span-627"><span class="mi" id="MathJax-Span-628" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-629" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="munderover" id="MathJax-Span-630"><span style="display: inline-block; position: relative; width: 0.571em; height: 0px;"><span style="position: absolute; clip: rect(1.708em 1000em 2.483em -0.411em); top: -2.323em; left: 0.003em;"><span class="mi" id="MathJax-Span-631" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; clip: rect(2.018em 1000em 2.432em -0.463em); top: -2.891em; left: 0.054em;"><span class="mo" id="MathJax-Span-632" style=""><span style="display: inline-block; position: relative; width: 0.468em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.977em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 3.982em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.977em; left: 0.158em;">⎯<span style="display: inline-block; width: 0px; height: 3.982em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.483em;"></span></span></span></span><span class="texatom" id="MathJax-Span-633"><span class="mrow" id="MathJax-Span-634"><span class="mo" id="MathJax-Span-635" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-636"><span style="display: inline-block; position: relative; width: 0.829em; height: 0px;"><span style="position: absolute; clip: rect(1.708em 1000em 2.483em -0.463em); top: -2.323em; left: 0.003em;"><span class="mi" id="MathJax-Span-637" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.468em;"><span class="mn" id="MathJax-Span-638" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.276em;"></span></span></span></span><span class="mo" id="MathJax-Span-639" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-640"><span style="display: inline-block; position: relative; width: 0.829em; height: 0px;"><span style="position: absolute; clip: rect(1.708em 1000em 2.483em -0.463em); top: -2.323em; left: 0.003em;"><span class="mi" id="MathJax-Span-641" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.468em;"><span class="mn" id="MathJax-Span-642" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.276em;"></span></span></span></span><span class="mo" id="MathJax-Span-643" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-644"><span style="display: inline-block; position: relative; width: 0.829em; height: 0px;"><span style="position: absolute; clip: rect(1.708em 1000em 2.483em -0.463em); top: -2.323em; left: 0.003em;"><span class="mi" id="MathJax-Span-645" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.468em;"><span class="mn" id="MathJax-Span-646" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.276em;"></span></span></span></span><span class="mo" id="MathJax-Span-647" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-648" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-649" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-650" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; clip: rect(0.881em 1000em 1.243em -0.463em); top: -1.289em; left: 0.003em;"><span style="border-left-width: 5.119em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.088em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.276em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 2.47em; vertical-align: -1.063em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-21">\frac{P(Y|X_1,X_2,X_3...)}{P(\overline{Y}|X_1,X_2,X_3...)}</script>是否大于1即可。但是,工程上用除法不太方便,两边同时取对数log,得到:

<nobr><span class="math" id="MathJax-Span-651" style="width: 23.469em; display: inline-block;"><span style="display: inline-block; position: relative; width: 18.776em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.389em 1000em 3.523em -0.424em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-652"><span class="mi" id="MathJax-Span-653" style="font-family: STIXGeneral-Italic;">l<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-654" style="font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-655" style="font-family: STIXGeneral-Italic;">g</span><span class="texatom" id="MathJax-Span-656"><span class="mrow" id="MathJax-Span-657"><span class="mfrac" id="MathJax-Span-658"><span style="display: inline-block; position: relative; width: 5.069em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -2.397em;"><span class="mrow" id="MathJax-Span-659"><span class="mi" id="MathJax-Span-660" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-661" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-662" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="texatom" id="MathJax-Span-663"><span class="mrow" id="MathJax-Span-664"><span class="mo" id="MathJax-Span-665" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-666"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-667" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-668" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-669" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-670"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-671" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-672" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-673" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-674"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-675" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-676" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-677" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-678" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-679" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-680" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -2.451em;"><span class="mrow" id="MathJax-Span-681"><span class="mi" id="MathJax-Span-682" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-683" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="munderover" id="MathJax-Span-684"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-685" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-686" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="texatom" id="MathJax-Span-687"><span class="mrow" id="MathJax-Span-688"><span class="mo" id="MathJax-Span-689" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-690"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-691" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-692" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-693" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-694"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-695" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-696" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-697" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-698"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-699" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-700" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-701" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-702" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-703" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-704" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 5.069em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span></span><span class="mo" id="MathJax-Span-705" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mi" id="MathJax-Span-706" style="font-family: STIXGeneral-Italic; padding-left: 0.323em;">l<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-707" style="font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-708" style="font-family: STIXGeneral-Italic;">g</span><span class="texatom" id="MathJax-Span-709"><span class="mrow" id="MathJax-Span-710"><span class="mfrac" id="MathJax-Span-711"><span style="display: inline-block; position: relative; width: 5.069em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -2.397em;"><span class="mrow" id="MathJax-Span-712"><span class="mi" id="MathJax-Span-713" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-714" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-715"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-716" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-717" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-718" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-719"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-720" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-721" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-722" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-723"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-724" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-725" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-726" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-727" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-728" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="texatom" id="MathJax-Span-729"><span class="mrow" id="MathJax-Span-730"><span class="mo" id="MathJax-Span-731" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-732" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-733" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -2.451em;"><span class="mrow" id="MathJax-Span-734"><span class="mi" id="MathJax-Span-735" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-736" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-737"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-738" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-739" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-740" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-741"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-742" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-743" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-744" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-745"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-746" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-747" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-748" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-749" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-750" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="texatom" id="MathJax-Span-751"><span class="mrow" id="MathJax-Span-752"><span class="mo" id="MathJax-Span-753" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-754"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-755" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-756" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-757" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 5.069em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span><span class="mo" id="MathJax-Span-758" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">+</span><span class="mi" id="MathJax-Span-759" style="font-family: STIXGeneral-Italic; padding-left: 0.269em;">l<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-760" style="font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-761" style="font-family: STIXGeneral-Italic;">g</span><span class="texatom" id="MathJax-Span-762"><span class="mrow" id="MathJax-Span-763"><span class="mfrac" id="MathJax-Span-764"><span style="display: inline-block; position: relative; width: 1.603em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -0.637em;"><span class="mrow" id="MathJax-Span-765"><span class="mi" id="MathJax-Span-766" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-767" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-768" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-769" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -0.744em;"><span class="mrow" id="MathJax-Span-770"><span class="mi" id="MathJax-Span-771" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-772" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="munderover" id="MathJax-Span-773"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-774" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-775" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-776" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 1.603em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 2.403em; vertical-align: -1.063em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-22">log{\frac{P(Y|X_1,X_2,X_3...)}{P(\overline{Y}|X_1,X_2,X_3...)}} = log{\frac{P(X_1,X_2,X_3...|Y)}{P(X_1,X_2,X_3...|\overline{Y})}+log{\frac{P(Y)}{P(\overline{Y})}}}</script>

左边是螃蟹“是满黄”的逻辑发生比,只需要判断其是否大于0即可

到目前为止,以上都是等价变换

接下来我们引入贝叶斯方法中常用的条件独立假设:

<nobr><span class="math" id="MathJax-Span-777" style="width: 27.896em; display: inline-block;"><span style="display: inline-block; position: relative; width: 22.296em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.709em 1000em 2.883em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-778"><span class="mi" id="MathJax-Span-779" style="font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-780" style="font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-781"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-782" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-783" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-784" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-785" style="padding-left: 0.216em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-786" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-787" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-788" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-789" style="padding-left: 0.216em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-790" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-791" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-792" style="font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-793" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-794" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="texatom" id="MathJax-Span-795" style="padding-left: 0.216em;"><span class="mrow" id="MathJax-Span-796"><span class="mo" id="MathJax-Span-797" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-798" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-799" style="font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-800" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mi" id="MathJax-Span-801" style="font-family: STIXGeneral-Italic; padding-left: 0.323em;">P</span><span class="mo" id="MathJax-Span-802" style="font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-803"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-804" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-805" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="texatom" id="MathJax-Span-806"><span class="mrow" id="MathJax-Span-807"><span class="mo" id="MathJax-Span-808" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-809" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-810" style="font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-811" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">×</span><span class="mi" id="MathJax-Span-812" style="font-family: STIXGeneral-Italic; padding-left: 0.269em;">P</span><span class="mo" id="MathJax-Span-813" style="font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-814"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-815" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-816" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="texatom" id="MathJax-Span-817"><span class="mrow" id="MathJax-Span-818"><span class="mo" id="MathJax-Span-819" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-820" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-821" style="font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-822" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">×</span><span class="mi" id="MathJax-Span-823" style="font-family: STIXGeneral-Italic; padding-left: 0.269em;">P</span><span class="mo" id="MathJax-Span-824" style="font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-825"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-826" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-827" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="texatom" id="MathJax-Span-828"><span class="mrow" id="MathJax-Span-829"><span class="mo" id="MathJax-Span-830" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-831" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-832" style="font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-833" style="font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-834" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-835" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.203em; vertical-align: -0.263em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-23">P(X_1,X_2,X_3...|Y)=P(X_1|Y)×P(X_2|Y)×P(X_3|Y)...</script>
<nobr><span class="math" id="MathJax-Span-836" style="width: 28.536em; display: inline-block;"><span style="display: inline-block; position: relative; width: 22.829em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.336em 1000em 2.883em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-837"><span class="mi" id="MathJax-Span-838" style="font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-839" style="font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-840"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-841" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-842" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-843" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-844" style="padding-left: 0.216em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-845" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-846" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-847" style="font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-848" style="padding-left: 0.216em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-849" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-850" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-851" style="font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-852" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-853" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="texatom" id="MathJax-Span-854" style="padding-left: 0.216em;"><span class="mrow" id="MathJax-Span-855"><span class="mo" id="MathJax-Span-856" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-857"><span style="display: inline-block; position: relative; width: 0.749em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.424em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-858" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -3.197em; left: 0.056em;"><span class="mo" id="MathJax-Span-859" style=""><span style="display: inline-block; position: relative; width: 0.643em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.376em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="font-family: STIXGeneral-Regular; position: absolute; top: -3.997em; left: 0.163em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-860" style="font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-861" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mi" id="MathJax-Span-862" style="font-family: STIXGeneral-Italic; padding-left: 0.323em;">P</span><span class="mo" id="MathJax-Span-863" style="font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-864"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-865" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-866" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="texatom" id="MathJax-Span-867"><span class="mrow" id="MathJax-Span-868"><span class="mo" id="MathJax-Span-869" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-870"><span style="display: inline-block; position: relative; width: 0.749em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.424em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-871" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -3.197em; left: 0.056em;"><span class="mo" id="MathJax-Span-872" style=""><span style="display: inline-block; position: relative; width: 0.643em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.376em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="font-family: STIXGeneral-Regular; position: absolute; top: -3.997em; left: 0.163em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-873" style="font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-874" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">×</span><span class="mi" id="MathJax-Span-875" style="font-family: STIXGeneral-Italic; padding-left: 0.269em;">P</span><span class="mo" id="MathJax-Span-876" style="font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-877"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-878" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-879" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="texatom" id="MathJax-Span-880"><span class="mrow" id="MathJax-Span-881"><span class="mo" id="MathJax-Span-882" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-883"><span style="display: inline-block; position: relative; width: 0.749em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.424em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-884" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -3.197em; left: 0.056em;"><span class="mo" id="MathJax-Span-885" style=""><span style="display: inline-block; position: relative; width: 0.643em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.376em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="font-family: STIXGeneral-Regular; position: absolute; top: -3.997em; left: 0.163em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-886" style="font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-887" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">×</span><span class="mi" id="MathJax-Span-888" style="font-family: STIXGeneral-Italic; padding-left: 0.269em;">P</span><span class="mo" id="MathJax-Span-889" style="font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-890"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-891" style="font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.643em;"><span class="mn" id="MathJax-Span-892" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="texatom" id="MathJax-Span-893"><span class="mrow" id="MathJax-Span-894"><span class="mo" id="MathJax-Span-895" style="font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-896"><span style="display: inline-block; position: relative; width: 0.749em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.723em -0.424em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-897" style="font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -3.197em; left: 0.056em;"><span class="mo" id="MathJax-Span-898" style=""><span style="display: inline-block; position: relative; width: 0.643em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.376em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="font-family: STIXGeneral-Regular; position: absolute; top: -3.997em; left: 0.163em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-899" style="font-family: STIXGeneral-Regular;">)</span><span class="mo" id="MathJax-Span-900" style="font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-901" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-902" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.67em; vertical-align: -0.263em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-24">P(X_1,X_2,X_3...|\overline{Y})=P(X_1|\overline{Y})×P(X_2|\overline{Y})×P(X_3|\overline{Y})...</script>

将它们带入上式,就变成了:

<nobr><span class="math" id="MathJax-Span-903" style="width: 30.669em; display: inline-block;"><span style="display: inline-block; position: relative; width: 24.536em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(3.949em 1000em 8.376em -0.424em); top: -5.117em; left: 0.003em;"><span class="mrow" id="MathJax-Span-904"><span style="display: inline-block; position: relative; width: 24.536em; height: 0px;"><span style="position: absolute; clip: rect(2.829em 1000em 4.963em -0.424em); top: -3.997em; left: 0.003em;"><span class="mi" id="MathJax-Span-905" style="font-family: STIXGeneral-Italic;">l<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-906" style="font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-907" style="font-family: STIXGeneral-Italic;">g</span><span class="texatom" id="MathJax-Span-908"><span class="mrow" id="MathJax-Span-909"><span class="mfrac" id="MathJax-Span-910"><span style="display: inline-block; position: relative; width: 5.069em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -2.397em;"><span class="mrow" id="MathJax-Span-911"><span class="mi" id="MathJax-Span-912" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-913" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-914" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="texatom" id="MathJax-Span-915"><span class="mrow" id="MathJax-Span-916"><span class="mo" id="MathJax-Span-917" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-918"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-919" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-920" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-921" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-922"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-923" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-924" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-925" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-926"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-927" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-928" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-929" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-930" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-931" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-932" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -2.451em;"><span class="mrow" id="MathJax-Span-933"><span class="mi" id="MathJax-Span-934" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-935" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="munderover" id="MathJax-Span-936"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-937" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-938" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="texatom" id="MathJax-Span-939"><span class="mrow" id="MathJax-Span-940"><span class="mo" id="MathJax-Span-941" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="msubsup" id="MathJax-Span-942"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-943" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-944" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-945" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-946"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-947" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-948" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-949" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">,</span><span class="msubsup" id="MathJax-Span-950"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-951" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-952" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="mo" id="MathJax-Span-953" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-954" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-955" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-956" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 5.069em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span></span><span class="mo" id="MathJax-Span-957" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="mi" id="MathJax-Span-958" style="font-family: STIXGeneral-Italic; padding-left: 0.323em;">l<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-959" style="font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-960" style="font-family: STIXGeneral-Italic;">g</span><span class="texatom" id="MathJax-Span-961"><span class="mrow" id="MathJax-Span-962"><span class="mfrac" id="MathJax-Span-963"><span style="display: inline-block; position: relative; width: 2.563em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -1.117em;"><span class="mrow" id="MathJax-Span-964"><span class="mi" id="MathJax-Span-965" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-966" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-967"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-968" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-969" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="texatom" id="MathJax-Span-970"><span class="mrow" id="MathJax-Span-971"><span class="mo" id="MathJax-Span-972" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-973" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-974" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -1.224em;"><span class="mrow" id="MathJax-Span-975"><span class="mi" id="MathJax-Span-976" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-977" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-978"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-979" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-980" style="font-size: 50%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="texatom" id="MathJax-Span-981"><span class="mrow" id="MathJax-Span-982"><span class="mo" id="MathJax-Span-983" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-984"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-985" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-986" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-987" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 2.563em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span></span><span class="mo" id="MathJax-Span-988" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">+</span><span class="mi" id="MathJax-Span-989" style="font-family: STIXGeneral-Italic; padding-left: 0.269em;">l<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-990" style="font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-991" style="font-family: STIXGeneral-Italic;">g</span><span class="texatom" id="MathJax-Span-992"><span class="mrow" id="MathJax-Span-993"><span class="mfrac" id="MathJax-Span-994"><span style="display: inline-block; position: relative; width: 2.563em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -1.117em;"><span class="mrow" id="MathJax-Span-995"><span class="mi" id="MathJax-Span-996" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-997" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-998"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-999" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-1000" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="texatom" id="MathJax-Span-1001"><span class="mrow" id="MathJax-Span-1002"><span class="mo" id="MathJax-Span-1003" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-1004" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-1005" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -1.224em;"><span class="mrow" id="MathJax-Span-1006"><span class="mi" id="MathJax-Span-1007" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-1008" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-1009"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-1010" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-1011" style="font-size: 50%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="texatom" id="MathJax-Span-1012"><span class="mrow" id="MathJax-Span-1013"><span class="mo" id="MathJax-Span-1014" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-1015"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-1016" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-1017" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-1018" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 2.563em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span></span><span class="mo" id="MathJax-Span-1019" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">+</span><span class="mi" id="MathJax-Span-1020" style="font-family: STIXGeneral-Italic; padding-left: 0.269em;">l<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-1021" style="font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-1022" style="font-family: STIXGeneral-Italic;">g</span><span class="texatom" id="MathJax-Span-1023"><span class="mrow" id="MathJax-Span-1024"><span class="mfrac" id="MathJax-Span-1025"><span style="display: inline-block; position: relative; width: 2.563em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -1.117em;"><span class="mrow" id="MathJax-Span-1026"><span class="mi" id="MathJax-Span-1027" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-1028" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-1029"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-1030" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-1031" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="texatom" id="MathJax-Span-1032"><span class="mrow" id="MathJax-Span-1033"><span class="mo" id="MathJax-Span-1034" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-1035" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-1036" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -1.224em;"><span class="mrow" id="MathJax-Span-1037"><span class="mi" id="MathJax-Span-1038" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-1039" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-1040"><span style="display: inline-block; position: relative; width: 0.803em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-1041" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mn" id="MathJax-Span-1042" style="font-size: 50%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="texatom" id="MathJax-Span-1043"><span class="mrow" id="MathJax-Span-1044"><span class="mo" id="MathJax-Span-1045" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-1046"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-1047" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-1048" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-1049" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 2.563em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span></span><span class="mo" id="MathJax-Span-1050" style="font-family: STIXGeneral-Regular;">+</span><span class="mo" id="MathJax-Span-1051" style="font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-1052" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-1053" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; clip: rect(2.829em 1000em 4.963em -0.424em); top: -1.704em; left: 0.003em;"><span class="mo" id="MathJax-Span-1054" style="font-family: STIXGeneral-Regular;">+</span><span class="mi" id="MathJax-Span-1055" style="font-family: STIXGeneral-Italic;">l<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-1056" style="font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-1057" style="font-family: STIXGeneral-Italic;">g</span><span class="texatom" id="MathJax-Span-1058"><span class="mrow" id="MathJax-Span-1059"><span class="mfrac" id="MathJax-Span-1060"><span style="display: inline-block; position: relative; width: 1.603em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -0.637em;"><span class="mrow" id="MathJax-Span-1061"><span class="mi" id="MathJax-Span-1062" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-1063" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="mi" id="MathJax-Span-1064" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-1065" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -0.744em;"><span class="mrow" id="MathJax-Span-1066"><span class="mi" id="MathJax-Span-1067" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-1068" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="munderover" id="MathJax-Span-1069"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-1070" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-1071" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-1072" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 1.603em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 5.123em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 5.27em; vertical-align: -3.93em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-25">log{\frac{P(Y|X_1,X_2,X_3...)}{P(\overline{Y}|X_1,X_2,X_3...)}} = log{\frac{P(X_1|Y)}{P(X_1|\overline{Y})}}+log{\frac{P(X_2|Y)}{P(X_2|\overline{Y})}}+log{\frac{P(X_3|Y)}{P(X_3|\overline{Y})}} +...+ log{\frac{P(Y)}{P(\overline{Y})}}</script>

于是我们得到了一个简单的求和式,只需要判断等式右边求和的结果是否大于0即可。而最关键的就是右边每一项都非常好求!假如训练集中所有的满黄螃蟹收集在一起,统计每一个特征出现的次数,除以满黄螃蟹的总数,就是其相应的条件(后验)概率了。再统计该特征在非满黄螃蟹集合中的条件(后验)概率,二者相除再取对数即可。

13. 用贝叶斯方法进行特征有效性分析

等式右边作为一个求和式,其中每个求和项<nobr><span class="math" id="MathJax-Span-1073" style="width: 5.171em; display: inline-block;"><span style="display: inline-block; position: relative; width: 3.982em; height: 0px; font-size: 129%;"><span style="position: absolute; clip: rect(1.295em 1000em 3.413em -0.411em); top: -2.478em; left: 0.003em;"><span class="mrow" id="MathJax-Span-1074"><span class="mi" id="MathJax-Span-1075" style="font-family: STIXGeneral-Italic;">l<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-1076" style="font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-1077" style="font-family: STIXGeneral-Italic;">g</span><span class="texatom" id="MathJax-Span-1078"><span class="mrow" id="MathJax-Span-1079"><span class="mfrac" id="MathJax-Span-1080"><span style="display: inline-block; position: relative; width: 2.483em; height: 0px; margin-right: 0.106em; margin-left: 0.106em;"><span style="position: absolute; clip: rect(1.708em 1000em 2.587em -0.463em); top: -2.84em; left: 50%; margin-left: -1.083em;"><span class="mrow" id="MathJax-Span-1081"><span class="mi" id="MathJax-Span-1082" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-1083" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-1084"><span style="display: inline-block; position: relative; width: 0.726em; height: 0px;"><span style="position: absolute; clip: rect(1.708em 1000em 2.483em -0.463em); top: -2.323em; left: 0.003em;"><span class="mi" id="MathJax-Span-1085" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.468em;"><span class="mi" id="MathJax-Span-1086" style="font-size: 50%; font-family: STIXGeneral-Italic;">i</span><span style="display: inline-block; width: 0px; height: 2.276em;"></span></span></span></span><span class="texatom" id="MathJax-Span-1087"><span class="mrow" id="MathJax-Span-1088"><span class="mo" id="MathJax-Span-1089" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-1090" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span class="mo" id="MathJax-Span-1091" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; clip: rect(1.398em 1000em 2.587em -0.463em); top: -1.651em; left: 50%; margin-left: -1.186em;"><span class="mrow" id="MathJax-Span-1092"><span class="mi" id="MathJax-Span-1093" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-1094" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-1095"><span style="display: inline-block; position: relative; width: 0.726em; height: 0px;"><span style="position: absolute; clip: rect(1.708em 1000em 2.483em -0.463em); top: -2.323em; left: 0.003em;"><span class="mi" id="MathJax-Span-1096" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; top: -2.168em; left: 0.468em;"><span class="mi" id="MathJax-Span-1097" style="font-size: 50%; font-family: STIXGeneral-Italic;">i</span><span style="display: inline-block; width: 0px; height: 2.276em;"></span></span></span></span><span class="texatom" id="MathJax-Span-1098"><span class="mrow" id="MathJax-Span-1099"><span class="mo" id="MathJax-Span-1100" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-1101"><span style="display: inline-block; position: relative; width: 0.571em; height: 0px;"><span style="position: absolute; clip: rect(1.708em 1000em 2.483em -0.411em); top: -2.323em; left: 0.003em;"><span class="mi" id="MathJax-Span-1102" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.054em;"></span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; clip: rect(2.018em 1000em 2.432em -0.463em); top: -2.891em; left: 0.054em;"><span class="mo" id="MathJax-Span-1103" style=""><span style="display: inline-block; position: relative; width: 0.468em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.977em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 3.982em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.977em; left: 0.158em;">⎯<span style="display: inline-block; width: 0px; height: 3.982em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.483em;"></span></span></span></span><span class="mo" id="MathJax-Span-1104" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.328em;"></span></span><span style="position: absolute; clip: rect(0.881em 1000em 1.243em -0.463em); top: -1.289em; left: 0.003em;"><span style="border-left-width: 2.483em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.088em;"></span></span></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.483em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 2.47em; vertical-align: -1.063em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-26">log{\frac{P(X_i|Y)}{P(X_i|\overline{Y})}}</script>的绝对值越大,其对结果的影响越强烈,相对应的特征就是显著特征。而绝对值比较小的特征就是非显著特征,剔除掉也不会很明显地影响结果。这就完成了一个特征筛选的过程。

我们再分析一下各个求和项的结构,里面的概率部分是后验概率,是特征相对于标签的后验概率。这个后验概率与我们上一篇文章《从白富美相亲看特征预处理与选择(上)》中的后验概率方向相反,不要搞混淆了。

14. 贝叶斯与逻辑回归之间的关系

我们继续看看这个求和项,是不是很像逻辑回归中的求和项?我们如果拿二元特征当做连续变量采用逻辑回归方法。其判别式如下:

<nobr><span class="math" id="MathJax-Span-1105" style="width: 25.549em; display: inline-block;"><span style="display: inline-block; position: relative; width: 20.429em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.603em 1000em 2.936em -0.477em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-1106"><span class="mi" id="MathJax-Span-1107" style="font-family: STIXGeneral-Italic;">z</span><span class="mo" id="MathJax-Span-1108" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="msubsup" id="MathJax-Span-1109" style="padding-left: 0.323em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.477em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-1110" style="font-family: STIXGeneral-Italic;">w</span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.696em;"><span class="mn" id="MathJax-Span-1111" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1112"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-1113" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.483em;"><span class="mn" id="MathJax-Span-1114" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">1</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-1115" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">+</span><span class="msubsup" id="MathJax-Span-1116" style="padding-left: 0.269em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.477em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-1117" style="font-family: STIXGeneral-Italic;">w</span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.696em;"><span class="mn" id="MathJax-Span-1118" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1119"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-1120" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.483em;"><span class="mn" id="MathJax-Span-1121" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">2</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-1122" style="font-family: STIXGeneral-Regular; padding-left: 0.269em;">+</span><span class="msubsup" id="MathJax-Span-1123" style="padding-left: 0.269em;"><span style="display: inline-block; position: relative; width: 1.123em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.477em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-1124" style="font-family: STIXGeneral-Italic;">w</span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.696em;"><span class="mn" id="MathJax-Span-1125" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="msubsup" id="MathJax-Span-1126"><span style="display: inline-block; position: relative; width: 0.909em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-1127" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.483em;"><span class="mn" id="MathJax-Span-1128" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">3</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-1129" style="font-family: STIXGeneral-Regular;">+</span><span class="mo" id="MathJax-Span-1130" style="font-family: STIXGeneral-Regular;">.</span><span class="mo" id="MathJax-Span-1131" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-1132" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">.</span><span class="mo" id="MathJax-Span-1133" style="font-family: STIXGeneral-Regular; padding-left: 0.216em;">+</span><span class="mi" id="MathJax-Span-1134" style="font-family: STIXGeneral-Italic;">b</span><span class="mo" id="MathJax-Span-1135" style="font-family: STIXGeneral-Regular;">;</span><span class="texatom" id="MathJax-Span-1136" style="padding-left: 0.216em;"><span class="mrow" id="MathJax-Span-1137"><span class="mo" id="MathJax-Span-1138"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">其</span></span></span></span><span class="texatom" id="MathJax-Span-1139"><span class="mrow" id="MathJax-Span-1140"><span class="mo" id="MathJax-Span-1141"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">中</span></span></span></span><span class="msubsup" id="MathJax-Span-1142"><span style="display: inline-block; position: relative; width: 0.749em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.531em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-1143" style="font-family: STIXGeneral-Italic;">x<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.483em;"><span class="mi" id="MathJax-Span-1144" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">i</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span><span class="mo" id="MathJax-Span-1145" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">∈</span><span class="mo" id="MathJax-Span-1146" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">{</span><span class="mn" id="MathJax-Span-1147" style="font-family: STIXGeneral-Regular;">0</span><span class="texatom" id="MathJax-Span-1148"><span class="mrow" id="MathJax-Span-1149"><span class="mo" id="MathJax-Span-1150"><span style="font-family: STIXGeneral, 'Arial Unicode MS', serif; font-size: 80%; font-style: normal; font-weight: normal;">,</span></span></span></span><span class="mn" id="MathJax-Span-1151" style="font-family: STIXGeneral-Regular;">1</span><span class="mo" id="MathJax-Span-1152" style="font-family: STIXGeneral-Regular;">}</span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.403em; vertical-align: -0.33em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-27">z=w_1x_1+w_2x_2+w_3x_3+ ...+b; 其中x_i∈\{0,1\}</script>

二者的表达式惊人地相似!莫非<nobr><span class="math" id="MathJax-Span-1153" style="width: 7.843em; display: inline-block;"><span style="display: inline-block; position: relative; width: 6.243em; height: 0px; font-size: 125%;"><span style="position: absolute; clip: rect(1.389em 1000em 3.523em -0.424em); top: -2.557em; left: 0.003em;"><span class="mrow" id="MathJax-Span-1154"><span class="mi" id="MathJax-Span-1155" style="font-family: STIXGeneral-Italic;">l<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.003em;"></span></span><span class="mi" id="MathJax-Span-1156" style="font-family: STIXGeneral-Italic;">o</span><span class="mi" id="MathJax-Span-1157" style="font-family: STIXGeneral-Italic;">g</span><span class="texatom" id="MathJax-Span-1158"><span class="mrow" id="MathJax-Span-1159"><span class="mfrac" id="MathJax-Span-1160"><span style="display: inline-block; position: relative; width: 2.456em; height: 0px; margin-right: 0.109em; margin-left: 0.109em;"><span style="position: absolute; clip: rect(1.763em 1000em 2.669em -0.477em); top: -2.931em; left: 50%; margin-left: -1.064em;"><span class="mrow" id="MathJax-Span-1161"><span class="mi" id="MathJax-Span-1162" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-1163" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-1164"><span style="display: inline-block; position: relative; width: 0.696em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-1165" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mi" id="MathJax-Span-1166" style="font-size: 50%; font-family: STIXGeneral-Italic;">i</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="texatom" id="MathJax-Span-1167"><span class="mrow" id="MathJax-Span-1168"><span class="mo" id="MathJax-Span-1169" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="mi" id="MathJax-Span-1170" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span class="mo" id="MathJax-Span-1171" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(1.496em 1000em 2.669em -0.477em); top: -1.704em; left: 50%; margin-left: -1.171em;"><span class="mrow" id="MathJax-Span-1172"><span class="mi" id="MathJax-Span-1173" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">P</span><span class="mo" id="MathJax-Span-1174" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">(</span><span class="msubsup" id="MathJax-Span-1175"><span style="display: inline-block; position: relative; width: 0.696em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.477em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-1176" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">X<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.429em;"><span class="mi" id="MathJax-Span-1177" style="font-size: 50%; font-family: STIXGeneral-Italic;">i</span><span style="display: inline-block; width: 0px; height: 2.349em;"></span></span></span></span><span class="texatom" id="MathJax-Span-1178"><span class="mrow" id="MathJax-Span-1179"><span class="mo" id="MathJax-Span-1180" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">|</span></span></span><span class="munderover" id="MathJax-Span-1181"><span style="display: inline-block; position: relative; width: 0.589em; height: 0px;"><span style="position: absolute; clip: rect(1.763em 1000em 2.563em -0.424em); top: -2.397em; left: 0.003em;"><span class="mi" id="MathJax-Span-1182" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">Y<span style="display: inline-block; overflow: hidden; height: 1px; width: 0.056em;"></span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(2.136em 1000em 2.509em -0.477em); top: -2.984em; left: 0.056em;"><span class="mo" id="MathJax-Span-1183" style=""><span style="display: inline-block; position: relative; width: 0.483em; height: 0px;"><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.003em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span><span style="position: absolute; font-family: STIXGeneral-Regular; top: -3.997em; left: 0.216em;">⎯<span style="display: inline-block; width: 0px; height: 4.003em;"></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span></span><span class="mo" id="MathJax-Span-1184" style="font-size: 70.7%; font-family: STIXGeneral-Regular;">)</span></span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span><span style="position: absolute; clip: rect(0.856em 1000em 1.229em -0.477em); top: -1.277em; left: 0.003em;"><span style="border-left-width: 2.456em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 1.25px; vertical-align: 0.003em;"></span><span style="display: inline-block; width: 0px; height: 1.069em;"></span></span></span></span></span></span><span class="mo" id="MathJax-Span-1185" style="font-family: STIXGeneral-Regular; padding-left: 0.323em;">=</span><span class="msubsup" id="MathJax-Span-1186" style="padding-left: 0.323em;"><span style="display: inline-block; position: relative; width: 0.963em; height: 0px;"><span style="position: absolute; clip: rect(1.976em 1000em 2.723em -0.477em); top: -2.557em; left: 0.003em;"><span class="mi" id="MathJax-Span-1187" style="font-family: STIXGeneral-Italic;">w</span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span><span style="position: absolute; top: -2.237em; left: 0.696em;"><span class="mi" id="MathJax-Span-1188" style="font-size: 70.7%; font-family: STIXGeneral-Italic;">i</span><span style="display: inline-block; width: 0px; height: 2.403em;"></span></span></span></span></span><span style="display: inline-block; width: 0px; height: 2.563em;"></span></span></span><span style="border-left-width: 0.003em; border-left-style: solid; display: inline-block; overflow: hidden; width: 0px; height: 2.403em; vertical-align: -1.063em;"></span></span></nobr><script type="math/tex" id="MathJax-Element-28">log{\frac{P(X_i|Y)}{P(X_i|\overline{Y})}}=w_i</script>,二者一模一样?

感兴趣的同学可以自己举个例子试一下,发现还是有区别的,二者求出来的权重不一样。产生这样差别的原因是什么呢?

想必大家都猜到了。就是贝叶斯方法引入的两个条件独立假设。正因为这两个条件独立假设,贝叶斯方法直接跳过了逻辑回归中反复迭代用梯度下降法才能求出的各个权重。

因此贝叶斯方法与逻辑回归的区别就是贝叶斯方法引入了一个更强的附加假设,而且可以直接通过统计结果求权重,而不必用梯度下降法。

所以有些情况下贝叶斯方法求出来的结果不好,就可以考虑考虑是不是条件独立假设的原因

因此,可以说“在某种假定下,可以证明:与朴素贝叶斯分类方法一样,许多神经网络和曲线拟合算法输出最大的后验假定。”——韩家炜:《数据挖掘:概念与技术(第三版)》

15. 剧情四:李雷露馅儿了

韩梅梅听完,十分感慨地说:“难怪机器学习能挑出正确的结果,难怪赵媒婆用机器学习方法从这么多人中能把你挑出里来。你还是有两下子嘛。”

“废话,她是我干妈”,李雷志得意满,不小心说漏嘴。 韩梅梅:“什么?!”

李雷后悔不已,尴尬地陪着笑脸说道:“梅梅,我错了,我不该瞒你这么久。”到了这个地步,李雷只能和盘托出了。

16. 数据VS算法

其实李雷早就知道韩妈妈要挑选相亲名单,如果按她的标准,李雷根本没法进入名单中。而李雷也猜想她会去找赵媒婆。他就早早地联系赵媒婆,跟她推销他的机器学习方法。赵媒婆终于被李雷忽悠动心了。李雷就帮她开发那个相亲算法。但其实赵媒婆的样本数量不够,特征数量却非常多,肯定会过拟合。李雷就跟她说他会多找一些相亲的数据。李雷能从哪里找啊,只能发动周围的同学,让他们找他们观察到的情侣案例。而在这些群体中,恰好中学、大学是同学的情侣比率非常高,而且很多男方是码农。而李雷刚好符合这个条件,李雷的评分就非常高了。

因为样本选择本来就代表性不足,没能覆盖更多的青年群体,所以还是过拟合,只是偏向了李雷这边的概率而已

可见,做机器学习虽然看起来比较炫酷的是算法,但真正关键的是数据。数据决定了你结果的上限,而算法只是尽可能逼近这个上限。而这点李雷并没有告诉赵媒婆。

对样本情况的分析要在特征优化过程中尤其注意。整个流程图如下:

特征处理

17. 特征选择的局限性

而且,李雷并不觉得感情这样复杂的东西能够用赵媒婆那些量化的指标衡量好的。房子、车子、学历、文凭这些并不能衡量两个人之间的感情。一些非常重要的特征是难以量化的,比如两个人的“三观”、两个人对待感情的态度、两个人相互相处的独一无二的经历、两个人刻骨铭心的情感体验、那种两个人相信能够一辈子都在一起的笃定的感觉……这些至关重要的特征极其复杂,却非常难以量化。所以对于这类问题,机器学习的能力还是很有限的。

18. 剧情五:尾声

韩梅梅听完李雷,既生气,又好笑,还有一点点小感动:这小子为了感情还是蛮拼的。

一段沉默之后,韩梅梅笑着对李雷说:“好了好了,我不怪你了。”李雷长舒一口气。

韩梅梅继续说:“问个挑螃蟹的问题。你刚才选了这么多特征。为什么不考虑用B超直接照一下,看看里面什么东西不就成了吗?”

李雷一听,犹如当头一棒,整个脑子都被占满了:“我去,这么简单的方法我怎么想不到?!”

韩梅梅这时已经笑得肚子痛了,根本说不上话。

李雷吐槽到:“梅梅,你太厉害了。我觉得机器永远也学不到的两样东西就是人类的情感和脑洞啊!”

19. 后记

其实博主也没有丧心病狂到抓只螃蟹去照B超,只是自己被这个想法逗乐了,大家开心就好哈。O(∩_∩)O~~

如果真要死磕,据说B超的穿透力比较弱,对骨骼、空气等很难达到深部,因此难以成像。但是通过声波的回声来判断,也是一个思路。就像有些人可以通过拍打西瓜听声音来判断它甜不甜的道理一样。

如果不用机械波而用电磁波,比如X射线,估计哪怕能看到螃蟹满黄顾客也不会吃了。顾客也会担心放射残留的。CT应该好些,但是贵呀。一套设备下来,螃蟹估计也不止120块钱了吧。没玩过CT,不知道成本多少……总之还是要考虑获取特征的成本的。

<script type="text/javascript"> $(function () { $('pre.prettyprint code').each(function () { var lines = $(this).text().split('\n').length; var $numbering = $('<ul/>').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('<li/>').text(i)); }; $numbering.fadeIn(1700); }); }); </script>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics