❔Conditional Probablity & Bayes’ Theorem for Data Science
How to approach a real-world problem? Bringing mathematical theorems & data together
Table of Contents
Conditional Probability
An airport hires you to estimate how the punctuality of flight arrivals is affected by the weather. You begin by defining a probability space for which the sample space is {late and rain, late and no rain, on time and rain, on time and no rain} . From data of past flights you determine that a reasonable estimate for the probability measure of the probability space is P (late, no rain) = 2/20 , P (on time, no rain) = 14/20 , P (late,rain) = 3/20 , P(on time,rain) = 1/20 .
What is actually our Problem Statement here?
How can we calculate this probability?
Suppose, your aunt is arriving at the airport tomorrow and you would like to know how likely it is for her flight to be on time. From the above example, you recall that P (on time| no rain) = 14/20, P (on time | rain) = 1/20.After checking out a weather website, you determine that P (rain) = 0.2. Now, how can we integrate all of this information to estimate the your aunt’s arrival?
The law of total probability
P(A) = Σ P (A ∩ S)
P(A ∩ B) =P(A | B) * P(B)
You explain above mentioned probabilistic model to your friend. You tell them that your aunt arrived late but you don’t mention if it rained or not. Now, if they want to calculate the probability of it raining, they can’t directly consider P(rain)=0.2 as mentioned in the earlier problem.
Bayes’ Theorem
P (A|B) = [P (A) *P (B|A)] / P (B)
When to apply Conditional Probability & when to apply Bayes’ Theorem?
References:
Let’s think better together!
Previousscikit-learn pipelinesNextROI Segmentation, Contour Detection and Image Thresholding Using OpenCV
Last updated