Bayes' theorem

Let's consider two probabilistic events, A and B. We can correlate the marginal probabilities P(A) and P(B) with the conditional probabilities P(A|B) and P(B|A), using the product rule:

Considering that the intersection is commutative, the first members are equal, so we can derive Bayes' theorem:

In the general discrete case, the formula can be re-expressed considering all possible outcomes for the random variable A:

As the denominator ...

Get Machine Learning Algorithms - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.