邊際概率條件概率_數據科學家解釋的邊際聯合和條件概率

邊際概率條件概率

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.pswp.cn/news/389660.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/389660.shtml
英文地址,請注明出處:http://en.pswp.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><…