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

贝叶斯 定理

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,一经查实,立即删除!

相关文章

文本数据可视化_如何使用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…

linux shell 编程

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

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

真实感人故事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…

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…

新建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…

视图可视化 后台_如何在单视图中可视化复杂的多层主题

视图可视化 后台Sometimes a dataset can tell many stories. Trying to show them all in a single visualization is great, but can be too much of a good thing. How do you avoid information overload without oversimplification?有时数据集可以讲述许多故事。 试图在…

一步一步构建自己的管理系统①

2019独角兽企业重金招聘Python工程师标准>>> 系统肯定要先选一个基础框架。 还算比较熟悉Spring. 就选Spring boot postgres mybatis. 前端用Angular. 开始搭开发环境,开在window上整的。 到时候再放到服务器上。 自己也去整了个小服务器,…

python边玩边学_边听边学数据科学

python边玩边学Podcasts are a fun way to learn new stuff about the topics you like. Podcast hosts have to find a way to explain complex ideas in simple terms because no one would understand them otherwise 🙂 In this article I present a few episod…

react css多个变量_如何使用CSS变量和React上下文创建主题引擎

react css多个变量CSS variables are really cool. You can use them for a lot of things, like applying themes in your application with ease. CSS变量真的很棒。 您可以将它们用于很多事情,例如轻松地在应用程序中应用主题。 In this tutorial Ill show you …

vue 自定义 移动端筛选条件

1.创建组件 components/FilterBar/FilterBar.vue <template><div class"filterbar" :style"{top: top px}"><div class"container"><div class"row"><divclass"col":class"{selected: ind…

PPPOE拨号上网流程及密码窃取具体实现

楼主学生党一枚&#xff0c;最近研究netkeeper有些许心得。 关于netkeeper是调用windows的rasdial来进行上网的东西&#xff0c;网上已经有一大堆&#xff0c;我就不赘述了。 本文主要讲解rasdial的部分核心过程&#xff0c;以及我们可以利用它来干些什么。 netkeeper中rasdial…

新购阿里云服务器ECS创建之后无法ssh连接的问题处理

作者&#xff1a;13 GitHub&#xff1a;https://github.com/ZHENFENG13 版权声明&#xff1a;本文为原创文章&#xff0c;未经允许不得转载。 问题描述 由于原服务器将要到期&#xff0c;因此趁着阿里云搞促销活动重新购买了一台ECS服务器&#xff0c;但是在初始化并启动后却无…

边缘计算 ai_在边缘探索AI!

边缘计算 ai介绍 (Introduction) What is Edge (or Fog) Computing?什么是边缘(或雾)计算&#xff1f; Gartner defines edge computing as: “a part of a distributed computing topology in which information processing is located close to the edge — where things a…

初识spring-boot

使用Spring或者SpringMVC的话依然有许多东西需要我们进行配置&#xff0c;这样不仅徒增工作量而且在跨平台部署时容易出问题。 使用Spring Boot可以让我们快速创建一个基于Spring的项目&#xff0c;而让这个Spring项目跑起来我们只需要很少的配置就可以了。Spring Boot主要有如…

leetcode 879. 盈利计划(dp)

这是我参与更文挑战的第9天 &#xff0c;活动详情查看更文挑战 题目 集团里有 n 名员工&#xff0c;他们可以完成各种各样的工作创造利润。 第 i 种工作会产生 profit[i] 的利润&#xff0c;它要求 group[i] 名成员共同参与。如果成员参与了其中一项工作&#xff0c;就不能…