Sitemap
Firengiz Kerimova

Firengiz Kerimova

Data Scientist / Artificial Intelligence Developer, linkedin.com/in/firengız-kerimova

Bayes Theorem.

2 min readAug 21, 2023

--

Türkçe açiklama:

Bu örnek, gözlemlerin ve geçmiş verilerin Bayes Teoremi kullanılarak nasıl bir tahmine dönüştürülebileceğini basitçe göstermektedir.

Örnek: Hava durumu tahmini yapmak istediğinizi düşünün. Belirli bir günün yağmurlu (Y) ya da yağmursuz (N) olma olasılığını değerlendirmek istiyorsunuz.

Varsayımlar:

Geçmiş verilere dayanarak, yağmurlu bir gün olma olasılığı P(Y) = 0.25, yağmursuz bir gün olma olasılığı P(N) = 0.75 olsun.

Meteoroloji raporlarına göre, yağmurlu bir gününü öncesinde bulutlu olma olasılığı P(B|Y) = 0.80, yağmursuz bir gününü öncesinde bulutlu olma olasılığı P(B|N) = 0.40 olarak hesaplanmış.

Soru: Bugün bulutlu bir gökyüzü görüyorsunuz. Yağmurlu bir gün mü, yoksa yağmursuz bir gün mü olduğunu tahmin etmek istiyorsunuz.

Çözüm: Bayes Teoremi’ni kullanarak sonucu hesaplayabiliriz.

Bizim tahminimiz yağmurlu (Y) ya da yağmursuz (N) olma durumlarıdır. Gözlemimiz bulutlu (B) bir gökyüzü.

P(Y|B) = P(B|Y) * P(Y) / P(B) P(Y|B) = 0.80 * 0.25 / P(B)

P(N|B) = P(B|N) * P(N) / P(B) P(N|B) = 0.40 * 0.75 / P(B)

P(B) değeri hesaplanması gereken toplam bulutlu gün olasılığıdır, ancak bu örnekte verilmemiş. Varsayımsal olarak kabul edelim: P(B) = 0.60 (örneğin).

Sonuçları hesaplayarak karşılaştırabiliriz:

Get Firengiz Kerimova’s stories in your inbox

Join Medium for free to get updates from this writer.

P(Y|B) = 0.80 * 0.25 / 0.60 = 0.3333

P(N|B) = 0.40 * 0.75 / 0.60 = 0.5000

Bu durumda, bulutlu bir gökyüzü görüldüğünde, yağmurlu olma olasılığı %33.33, yağmursuz olma olasılığı ise %50.00 olarak tahmin edilir.

Explain in English:

This example demonstrates how observations and past data can be transformed into predictions using Bayes’ Theorem in a simple way.

Example: Imagine you want to predict the weather. You want to evaluate the probability of a specific day being rainy (Y) or not rainy (N).

Assumptions:

Based on past data, the probability of a day being rainy is P(Y) = 0.25, and the probability of a day not being rainy is P(N) = 0.75. According to meteorological reports, the probability of a day being cloudy before it’s rainy, P(B|Y), is 0.80, and the probability of a day being cloudy before it’s not rainy, P(B|N), is 0.40. Question: You see a cloudy sky today. You want to predict whether it will be a rainy day or not.

Solution: We can calculate the result using Bayes’ Theorem.

Our prediction is either a rainy (Y) or not rainy (N) day. Our observation is a cloudy (B) sky.

P(Y|B) = P(B|Y) * P(Y) / P(B) P(Y|B) = 0.80 * 0.25 / P(B)

P(N|B) = P(B|N) * P(N) / P(B) P(N|B) = 0.40 * 0.75 / P(B)

P(B) is the required probability of a total cloudy day, but it’s not given in this example. Let’s assume: P(B) = 0.60 (for instance).

By calculating the results and comparing them:

P(Y|B) = 0.80 * 0.25 / 0.60 = 0.3333 P(N|B) = 0.40 * 0.75 / 0.60 = 0.5000

Therefore, when a cloudy sky is observed, the probability of it being rainy is 33.33%, and the probability of it not being rainy is 50.00%.

--

--