貝葉斯 定理_貝葉斯定理實際上是一個直觀的分數

貝葉斯 定理

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