Bayes theorem
The Bayes theorem is based on the concept of learning from experience, that is, using a sequence of steps to come to a prediction. It is the calculation of probability based on prior knowledge of occurrences that might have led to the event. Bayes theorem is given by the following formula:
Where:
Probability Value |
Description |
---|---|
P(A | B) |
Conditional probability of event A given that event B has occurred. |
P(B | A) |
Conditional probability of event B given that event A has occurred. |
P(A) |
Individual probability of event A without regard to event B. |
P(B) |
Individual probability of event B without regard to event A. |
Let's understand this using the same example as we used previously. Suppose we picked one green triangle randomly from a set then what is the probability that it came from Set-1?
Before we run the bayes theorem formula we will first calculate the individual probabilities:
Probability of randomly picking a set from one of the two sets, Set-1 and Set-2
Since there...