贝叶斯 定理_贝叶斯定理实际上是一个直观的分数

贝叶斯 定理

Bayes’ Theorem is one of the most known to the field of probability, and it is used often as a baseline model in machine learning. It is, however, too often memorized and chanted by people who don’t really know what P(B|E) = P(E|B) * P(B) / P(E) actually does. This short article will pick apart Bayes’ Theorem and show how it simplifies to an intuitive fraction we all use on a common basis.

贝叶斯定理是概率领域中最著名的定理之一,它经常被用作机器学习中的基线模型。 然而,它经常被那些并不真正知道P(B|E) = P(E|B) * P(B) / P(E)实际工作的人记住和高呼。 这篇简短的文章将分解贝叶斯定理,并说明如何将其简化为我们大家共同使用的直观分数。

First, some basic probability context.

首先,一些基本的概率背景。

The belief is a statement we would like to verify is correct or incorrect, like ‘a person is male’ or ‘a person has long hair’. The evidence is known information about the subject in the belief. Lastly, the | vertical pipe is used as the word ‘given…’. You’ll often see (B|E) as ‘the probability belief B is true, given the evidence E.’

信念是我们要验证正确或不正确的陈述,例如“一个人是男性”或“一个人有长发”。 证据是有关信念中受试者的已知信息。 最后, | 垂直管道被用作“给定...”一词。 在给定证据E的情况下,您经常会看到(B|E)为“概率信念B为真”。

Let’s take the following table of students at Hypothetical High School.

让我们看一下假设高中学生的下表。

Image for post

We want to find the probability that a person is female (belief) given long hair (evidence). This can be expressed as (female|long hair). Even without the theorem, this is quite simple to calculate, intuitively. We simply need to divide the number of females who have long hair by the total number of people who have long hair, which is 350/400=0.875.

我们想要找到在长发(证据)下一个人是女性(信念)的概率。 这可以表示为(female|long hair) 。 即使没有定理,这在直观上也很容易计算。 我们只需要将长发女性的数量除以长发总数即可,即350/400=0.875

It’s worthwhile diving a little into why we have this intuition. Since we know that the person has long hair, we look in the column of ‘Long Hair’ and the two classes within that category (being male or female). Then, our formula is simply people who are female and who have long hair divided by all people who have long hair.

值得深入探讨为什么我们有这种直觉。 由于我们知道该人长发,因此我们在“长发”列中查找该类别中的两个类别(男性或女性)。 那么,我们的公式就是女性,长发的人除以所有长发的人。

Hence, we can confidently say that, if you have long hair, you have a 87.5% chance of being a female at Hypothetical High School.

因此,我们可以自信地说,如果您留着长发,那么在假高中成为女性的可能性为87.5%。

Let’s use Bayes’ Theorem to solve this — and you’ll realize that it is simply putting into rigorously mathematical terms this intuition!

让我们使用贝叶斯定理来解决这个问题,您会意识到,它只是将这种直觉严格地数学化了!

Variable names from a-i will be used to represent different quantities. Remember that our intuitive formula was e/h, or the number of people who are female and have long hair, divided by the total number of people with long hair.

从变量名a - i将被用来代表不同的数量。 请记住,我们的直观公式是e/h ,即长发的女性人数除以长发总数。

Image for post

Bayes formula says the following:

贝叶斯公式表示以下内容:

P(B|E) = P(E|B)*P(B) / P(E)

This translates in our scenario to:

在我们的方案中,这意味着:

P(Female|Long Hair) = P(Long Hair|Female)*P(Female)/P(Long Hair)

Let’s represent these using variables. For example, the probability that someone has long hair given that they are female is e/f, since e represents the number of females with long hair and f represents the total number of females. P(Female) is f/i, since f is the number of females and i is the total number of people (males and females).

让我们使用变量来表示它们。 例如,某人由于是女性而e/f长发的概率为e/f ,因为e代表留长发的女性人数, f代表女性总数。 P(Female)f/i ,因为f是女性的数量,而i是总人数(男性和女性)。

P(Female|Long Hair) = (e/f)*(f/i) / (h/i) = (e/f)*(f/i)*(i/h)

With some simple algebraic manipulation, we realize that (e/f)*(f/i) results in (e/i), and (e/i)*(i/h) equals (e/h) — our intuitive formula!

通过一些简单的代数运算,我们意识到(e/f)*(f/i)结果为(e/i) ,而(e/i)*(i/h)等于(e/h) -我们的直观公式!

So, Bayes’ Theorem is really a roundabout way to express a simple idea. At least in our context of fraction manipulation, P(B) simply serves as a bridge to cancel out reciprocals. So, when use Bayes’ Theorem to calculate P(B|E), you are essentially calculating the following:

因此,贝叶斯定理实际上是表达简单思想的一种回旋方式。 至少在分数操作的上下文中, P(B)只是充当抵消倒数的桥梁。 因此,当使用贝叶斯定理来计算P(B|E) ,实际上是在计算以下内容:

# items that are B and E / total # items that are E

Bayes’ Theorem is useful for calculating this probability if it is difficult or thorny to directly calculate this by making use of other more accessible probabilities. This can be useful when calculating three separate probabilities is less expensive than calculating one primary one.

如果难以或棘手通过利用其他更容易获得的概率直接计算此概率,则贝叶​​斯定理对于计算该概率很有用。 当计算三个独立的概率比计算一个主要的概率便宜时,这将很有用。

At a higher level, one may be inclined to say that Bayes’ Theorem reveals relationships in the nature of probability. At a lower — and perhaps more practical — level, Bayes’ Theorem is a clever way to get around directly calculating a probability with other probabilities and chain multiplication.

在更高的层次上,人们可能倾向于说贝叶斯定理揭示了概率性质中的关系。 贝叶斯定理在较低的水平上,也许是在更实际的水平上,是一种聪明的方法,可以直接计算其他概率和链乘法的概率。

All images created by author.

作者创作的所有图像。

翻译自: https://towardsdatascience.com/bayes-theorem-is-actually-an-intuitive-fraction-5f2803998006

贝叶斯 定理

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/390710.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

winfrom 点击按钮button弹框显示颜色集

1.窗体托一个按钮button; 2.单击事件: 1 private void btnForeColor_Click(object sender, EventArgs e)2 {3 using (ColorDialog cdialog new ColorDialog())4 {5 cdialog.AnyColor true;6 …

JavaScript时间事件:setTimeout和setInterval

Programmers use timing events to delay the execution of certain code, or to repeat code at a specific interval.程序员使用时序事件来延迟某些代码的执行,或以特定的时间间隔重复代码。 There are two native functions in the JavaScript library used to …

webservice 基本要点

webservice的特点 webservices是自我包含的 webservices是自我描述的 webservices是跨平台和语言的 webservices是基于开放和标准的 webservices是可以组合的 webservices是松散耦合的 webservices提供编程访问的能力 webservices通过网络进行发布,查找和使用 发布w…

文本数据可视化_如何使用TextHero快速预处理和可视化文本数据

文本数据可视化自然语言处理 (Natural Language Processing) When we are working on any NLP project or competition, we spend most of our time on preprocessing the text such as removing digits, punctuations, stopwords, whitespaces, etc and sometimes visualizati…

Less变量

Less变量 定义变量 Less 中的变量和其他编程语言一样,可以实现值的复用,同样它也有作用域(scope)。简单的讲,变量作用域就是局部变量和全局变量的概念。 Less 中,变量作用域采用的是就近原则,换…

渐进式web应用程序_如何在渐进式Web应用程序中添加到主屏幕

渐进式web应用程序添加到主屏幕 (Add To Homescreen) Here the web app install banner is focused on web app, with the feature of add to homescreen.在此,Web应用程序安装标语专注于Web应用程序,具有添加到主屏幕的功能。 浏览器对“添加到主屏幕”…

linux shell 编程

shell的作用 shell是用户和系统内核之间的接口程序shell是命令解释器 shell程序 Shell程序的特点及用途: shell程序可以认为是将shell命令按照控制结构组织到一个文本文件中,批量的交给shell去执行 不同的shell解释器使用不同的shell命令语法 shell…

Leetcode之javascript解题(No33-34)

附上我的github仓库,会不断更新leetcode解题答案,提供一个思路,大家共勉 在我的主页和github上可以看到更多的关于leetcode的解题报告!(因为不知道为什么掘金没有将其发布出来,目前已经联系掘金客服&#x…

真实感人故事_您的数据可以告诉您真实故事吗?

真实感人故事Many are passionate about Data Analytics. Many love matplotlib and Seaborn. Many enjoy designing and working on Classifiers. We are quick to grab a data set and launch Jupyter Notebook, import pandas and NumPy and get to work. But wait a minute…

转:防止跨站攻击,安全过滤

转:http://blog.csdn.net/zpf0918/article/details/43952511 Spring MVC防御CSRF、XSS和SQL注入攻击 本文说一下SpringMVC如何防御CSRF(Cross-site request forgery跨站请求伪造)和XSS(Cross site script跨站脚本攻击)。 说说CSRF 对CSRF来说,其实Spring…

Linux c编程

c语言标准 ANSI CPOSIX(提高UNIX程序可移植性)SVID(POSIX的扩展超集)XPG(X/Open可移植性指南)GNU C(唯一能编译Linux内核的编译器) gcc 简介 名称: GNU project C an…

html怎么注释掉代码_HTML注释:如何注释掉您HTML代码

html怎么注释掉代码HTML中的注释 (Comments in HTML) The comment tag is an element used to leave notes, mostly related to the project or the website. This tag is frequently used to explain something in the code or leave some recommendations about the project.…

k均值算法 二分k均值算法_使用K均值对加勒比珊瑚礁进行分类

k均值算法 二分k均值算法Have you ever seen a Caribbean reef? Well if you haven’t, prepare yourself.您见过加勒比礁吗? 好吧,如果没有,请做好准备。 Today, we will be answering a question that, at face value, appears quite sim…

您好,这是我的第一篇文章

您好我是CYL 这是一个辣鸡博客 欢迎指教 转载于:https://www.cnblogs.com/pigba/p/8823472.html

08_MySQL DQL_SQL99标准中的多表查询(内连接)

# sql99语法/*语法: select 查询列表 from 表1 别名 【连接类型】 join 表2 别名 on 连接条件 【where 筛选条件】 【group by 分组】 【having 分组后筛选】 【order by 排序列表】分类内连接(重点): inner外连接 左外&#xff0…

java中抽象类继承抽象类_Java中的抽象类用示例解释

java中抽象类继承抽象类Abstract classes are classes declared with abstract. They can be subclassed or extended, but cannot be instantiated. You can think of them as a class version of interfaces, or as an interface with actual code attached to the methods.抽…

新建VUX项目

使用Vue-cli安装Vux2 特别注意配置vux-loader。来自为知笔记(Wiz)

衡量试卷难度信度_我们可以通过数字来衡量语言难度吗?

衡量试卷难度信度Without a doubt, the world is “growing smaller” in terms of our access to people and content from other countries and cultures. Even the COVID-19 pandemic, which has curtailed international travel, has led to increasing virtual interactio…

Linux 题目总结

守护进程的工作就是打开一个端口,并且等待(Listen)进入连接。 如果客户端发起一个连接请求,守护进程就创建(Fork)一个子进程响应这个连接,而主进程继续监听其他的服务请求。 xinetd能够同时监听…

《精通Spring4.X企业应用开发实战》读后感第二章

一、配置Maven\tomcat https://www.cnblogs.com/Miracle-Maker/articles/6476687.html https://www.cnblogs.com/Knowledge-has-no-limit/p/7240585.html 二、创建数据库表 DROP DATABASE IF EXISTS sampledb; CREATE DATABASE sampledb DEFAULT CHARACTER SET utf8; USE sampl…