边际概率条件概率_数据科学家解释的边际联合和条件概率

边际概率条件概率

Probability plays a very important role in Data Science, as Data Scientist regularly attempt to draw statistical inferences that could be used to predict data or analyse data better.

P robability起着数据科学非常重要的作用,为数据科学家经常试图绘制可以用来更好地预测数据或分析数据的统计推断。

Statistical inference is the process of using data analysis to deduce properties of an underlying distribution of probability (Source: Wikipedia), hence understanding random variables and their probability distributions is a required skill to work on many Data Science problems.

统计推断是使用数据分析来推断潜在概率分布的属性的过程( 来源 :Wikipedia),因此了解随机变量及其概率分布是解决许多数据科学问题的必备技能。

I am going to start this discussion by providing a scenario as we are going to be learning about probability distributions from this scenario.

我将通过提供一个场景开始此讨论,因为我们将从该场景中学习概率分布。

情境 (Scenario)

A survey was carried out with 500 strangers in London’s West End to determine people’s favorite sports. The options were Football, Rugby and the rest was grouped together in Other; The results of the test are displayed in Figure 1.

在伦敦西区,对500个陌生人进行了一项调查,以确定人们最喜欢的运动。 选项包括“足球”,“橄榄球”,其余分组在“其他”中。 测试结果如图1所示。

Image for post
Figure 1: The Results of the test
图1:测试结果

Figure 1 is not quite a probability distribution, but if we want to get the probability distribution we can simply divide each number in Figure 1 by 500 (number of observations) and the result will be the image in Figure 2.

图1并不是一个概率分布,但是如果我们想要获得概率分布,我们可以简单地将图1中的每个数字除以500(观察值的数量),结果将是图2中的图像。

Image for post
Figure 2: Probability Distribution
图2:概率分布

联合概率 (Joint Probability)

The Joint probability is a statistical measure that is used to calculate the probability of two events occurring together at the same time — P(A and B) or P(A,B). For example, using Figure 2 we can see that the joint probability of someone being a male and liking football is 0.24.

联合概率是一种统计量度,用于计算两个事件同时发生的概率-P(A和B)或P(A,B)。 例如,使用图2可以看到某人是男性并且喜欢足球的联合概率为0.24。

Image for post
Figure 3: The Joint Probability Distribution.
图3:联合概率分布。

Note: The cells highlighted in Figure 3 (the Joint Probability Distribution) must sum to 1 because everyone in the distribution must be in one of the cells.

注意 :图3中的单元格(联合概率分布)必须加1,因为分布中的每个人都必须位于其中一个单元格中。

The Joint probability is symmetrical meaning that P(Male and Football) = P(Football and Male) and we can also use it to find other types of distributions, the marginal distribution and the conditional distribution.

联合概率是对称的,意味着P(男和足球)= P(足球和男),我们也可以用它来找到其他类型的分布,即边际分布和条件分布。

边际分布 (Marginal Distribution)

In probability theory and statistics, the marginal distribution of a subset of a collection of random variables is the probability distribution of the variables contained in the subset. It gives the probabilities of various values of the variables in the subset without reference to the values of the other variables (Source: Wikipedia) — If that was too much jargon, to put it simply, the marginal probability is the probability of an event irrespective of the outcome of another variable — P(A) or P(B).

在概率论和统计学中,随机变量集合的子集的边际分布是子集中包含的变量的概率分布。 它给出了子集中变量的各种值的概率,而没有参考其他变量的值( 来源 : Wikipedia )—如果说的话太多了,简单来说,边际概率就是事件的概率另一个变量-P(A)或P(B)的结果。

Image for post
Figure 4: The Marginal Distribution
图4:边际分布

Note: Whether we ignore the gender or the sport our Marginal Distributions must sum to 1.

注意 :无论我们忽略性别还是运动,我们的边际分布总和必须为1。

A fun fact of marginal probability is that all the marginal probabilities appear in the margins — how cool is that. Hence the P(Female) = 0.46 which completely ignores the sport the Female prefers, and the P(Rugby) = 0.25 completely ignores the gender.

边际概率的一个有趣的事实是,所有边际概率都出现在边际中-这多么酷。 因此,P(女性)= 0.46完全忽略了女性偏爱的运动,而P(Rugby)= 0.25则完全忽略了性别。

条件概率 (Conditional Probability)

The conditional probability concept is one of the most fundamental in probability theory and in my opinion is a trickier type of probability. It defines the probability of one event occurring given that another event has occurred (by assumption, presumption, assertion or evidence).

条件概率概念是概率论中最基本的概念之一,在我看来是一种棘手的概率类型。 它定义了假设已发生另一事件(通过假设,推定,主张或证据)而发生一个事件的概率。

Image for post
Figure 5: Expression of the Conditional Probability
图5:条件概率的表达式

To make sense of this let’s again use Figure 2; If we want to calculate the probability that a person would like Rugby given that they are a female, we must take the joint probability that the person is female and likes rugby (P(Female and Rugby)) and divide it by the probability of the condition. In this case, the probability is that the person is a female (P(Female)) which we can work out from the margin to be 0.46 hence we get 0.11 (2 decimal places).

为了理解这一点,让我们再次使用图2 ; 如果要计算某人喜欢橄榄球的概率(假设某人是女性),则必须考虑该人是女性并且喜欢橄榄球的联合概率( P(Female and Rugby) ),然后将其除以概率健康)状况。 在这种情况下,概率是该人是一个女性( P(Female) ),我们可以从裕度算出其为0.46,因此得到0.11(小数点后两位)。

Let's write that up neater:

让我们写得更整洁一些:

P(Female, Rugby) = 0.05

P(女,橄榄球)= 0.05

P(Female) = 0.46

P(女)= 0.46

P(Rugby | Female) = 0.05 / 0.46 = 0.11 (to 2 decimal places).

P(橄榄球|母)= 0.05 / 0.46 = 0.11(小数点后2位)。

If we continued to fill in the probability of preferring a sport given the observant is a female then we would have a Conditional Probability Distribution.

如果在观察者是女性的情况下,如果我们继续填写喜欢某项运动的可能性,那么我们将获得条件概率分布。

结语 (Wrap Up)

This is guide is a very simple introduction to joint, marginal and conditional probability. Being a Data Scientist and knowing about these distributions may still get you death stares from the envious Statisticians, but at least this time it’s because they are just angry people rather than you being wrong — I am joking!

本指南是对联合概率,边际概率和条件概率的非常简单的介绍。 作为数据科学家并了解这些分布可能仍然会让您羡慕嫉妒的统计学家,但至少这次是因为他们只是在生气,而不是您在做错- 我在开玩笑!

Let’s continue the conversation on LinkedIn…

让我们继续在LinkedIn上进行对话…

翻译自: https://towardsdatascience.com/marginal-joint-and-conditional-probabilities-explained-by-data-scientist-4225b28907a4

边际概率条件概率

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

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

相关文章

1822. 数组元素积的符号

1822. 数组元素积的符号 已知函数 signFunc(x) 将会根据 x 的正负返回特定值: 如果 x 是正数,返回 1 。 如果 x 是负数,返回 -1 。 如果 x 是等于 0 ,返回 0 。 给你一个整数数组 nums 。令 product 为数组 nums 中所有元素值的…

java并发编程实战:第十四章----构建自定义的同步工具

一、状态依赖性管理 对于单线程程序,某个条件为假,那么这个条件将永远无法成真在并发程序中,基于状态的条件可能会由于其他线程的操作而改变1 可阻塞的状态依赖操作的结构2 3 acquire lock on object state4 while (precondition does not ho…

关于之前的函数式编程

之前写的函数式编程是我从 JavaScript ES6 函数式编程入门经典这本书里面整理的,然后只在第一篇里专门提到了,后面的话没有专门提到,而且引用了书中大量的文字,所以我把掘金这里的文章都删除了,然后在 CSDN 上面每一篇…

袋装决策树_袋装树是每个数据科学家需要的机器学习算法

袋装决策树袋装树木介绍 (Introduction to Bagged Trees) Without diving into the specifics just yet, it’s important that you have some foundation understanding of decision trees.尚未深入研究细节,对决策树有一定基础了解就很重要。 From the evaluatio…

[JS 分析] 天_眼_查 字体文件

0. 参考 js分析 猫_眼_电_影 字体文件 font-face 1. 分析 1.1 定位目标元素 1.2 查看网页源代码 1.3 requests 请求提取得到大量错误信息 对比猫_眼_电_影抓取到unicode编码,天_眼_查混合使用正常字体和自定义字体,难点在于如何从 红 转化为 美。 一开始…

深入学习Redis(4):哨兵

前言在 深入学习Redis(3):主从复制 中曾提到,Redis主从复制的作用有数据热备、负载均衡、故障恢复等;但主从复制存在的一个问题是故障恢复无法自动化。本文将要介绍的哨兵,它基于Redis主从复制,…

1805. 字符串中不同整数的数目

1805. 字符串中不同整数的数目 给你一个字符串 word ,该字符串由数字和小写英文字母组成。 请你用空格替换每个不是数字的字符。例如,“a123bc34d8ef34” 将会变成 " 123 34 8 34" 。注意,剩下的这些整数为(相邻彼此至…

经天测绘测量工具包_公共土地测量系统

经天测绘测量工具包部分-乡镇第一师 (Sections — First Divisions of Townships) The PLSS Townships are typically divided into 36 Sections (nominally one mile on a side), but in the national standard this feature is called the first division because Townships …

洛谷 P4012 深海机器人问题【费用流】

题目链接:https://www.luogu.org/problemnew/show/P4012 洛谷 P4012 深海机器人问题 输入输出样例 输入样例#1: 1 1 2 2 1 2 3 4 5 6 7 2 8 10 9 3 2 0 0 2 2 2 输出样例#1: 42 说明 题解:建图方法如下: 对于矩阵中的每…

day5 模拟用户登录

_user "yangtuo" _passwd "123456"# passd_authentication False #flag 标志位for i in range(3): #for 语句后面可以跟else,但是不能跟elifusername input("Username:")password input("Password:")if username _use…

opencv实现对象跟踪_如何使用opencv跟踪对象的距离和角度

opencv实现对象跟踪介绍 (Introduction) Tracking the distance and angle of an object has many practical uses, especially in robotics. This tutorial explains how to get an accurate distance and angle measurement, even when the target is at a strong angle from…

spring cloud 入门系列七:基于Git存储的分布式配置中心--Spring Cloud Config

我们前面接触到的spring cloud组件都是基于Netflix的组件进行实现的,这次我们来看下spring cloud 团队自己创建的一个全新项目:Spring Cloud Config.它用来为分布式系统中的基础设施和微服务提供集中化的外部配置支持,分为服务端和客户端两个…

458. 可怜的小猪

458. 可怜的小猪 有 buckets 桶液体,其中 正好 有一桶含有毒药,其余装的都是水。它们从外观看起来都一样。为了弄清楚哪只水桶含有毒药,你可以喂一些猪喝,通过观察猪是否会死进行判断。不幸的是,你只有 minutesToTest…

熊猫数据集_大熊猫数据框的5个基本操作

熊猫数据集Tips and Tricks for Data Science数据科学技巧与窍门 Pandas is a powerful and easy-to-use software library written in the Python programming language, and is used for data manipulation and analysis.Pandas是使用Python编程语言编写的功能强大且易于使用…

图嵌入综述 (arxiv 1709.07604) 译文五、六、七

应用 图嵌入有益于各种图分析应用,因为向量表示可以在时间和空间上高效处理。 在本节中,我们将图嵌入的应用分类为节点相关,边相关和图相关。 节点相关应用 节点分类 节点分类是基于从标记节点习得的规则,为图中的每个节点分配类标…

聊聊自动化测试框架

无论是在自动化测试实践,还是日常交流中,经常听到一个词:框架。之前学习自动化测试的过程中,一直对“框架”这个词知其然不知其所以然。 最近看了很多自动化相关的资料,加上自己的一些实践,算是对“框架”有…

1971. Find if Path Exists in Graph

1971. Find if Path Exists in Graph 有一个具有 n个顶点的 双向 图,其中每个顶点标记从 0 到 n - 1(包含 0 和 n - 1)。图中的边用一个二维整数数组 edges 表示,其中 edges[i] [ui, vi] 表示顶点 ui 和顶点 vi 之间的双向边。 …

移动磁盘文件或目录损坏且无法读取资料如何找回

文件或目录损坏且无法读取说明这个盘的文件系统结构损坏了。在平时如果数据不重要,那么可以直接格式化就能用了。但是有的时候里面的数据很重要,那么就必须先恢复出数据再格式化。具体恢复方法可以看正文了解(不格式化的恢复方法)…

python 平滑时间序列_时间序列平滑以实现更好的聚类

python 平滑时间序列In time series analysis, the presence of dirty and messy data can alter our reasonings and conclusions. This is true, especially in this domain, because the temporal dependency plays a crucial role when dealing with temporal sequences.在…

基于SmartQQ协议的QQ自动回复机器人-1

0. 本项目的原始代码及我二次开发后的代码 1. 软件安装:【myeclipse6.0 maven2】 0. https://blog.csdn.net/zgmzyr/article/details/6886440 1. https://blog.csdn.net/shuzhe66/article/details/45009175 2. https://www.cnblogs.com/whgk/p/7112560.html<mirror><…