Consider a store manager who wants to derive a purchase pattern of coffee
and sugar buyers. He wants to find out how likely a person buying coffee
will also buy sugar. The store manager knows that generally 50% of people
buying sugar also buy coffee. The prior probability of a customer buying
sugar is 1/200 and prior probability of a customer buying coffee is 1/50.
Therefore, we can obtain the following by using Bayes’ theorem:
PCoffeeSugar
PCoffee
(|)%.
()/
==
=
5005
150
PPSugarCoffee
PCoffeeSug
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.