Calculate posterior probability from prior, likelihood, and evidence using Bayes' theorem.
Bayes' theorem calculates the probability of a hypothesis given observed evidence: P(H|E) = P(E|H) × P(H) / P(E). It is the foundation of Bayesian inference, spam filters, medical diagnosis models, and any system that updates beliefs based on new data.
Bayes' Theorem
P(H|E) = P(E|H) * P(H) / P(E)
The prior is your initial belief about a hypothesis before seeing evidence. The posterior is the updated belief after incorporating the evidence through Bayes' theorem.
It underpins Naive Bayes classifiers, Bayesian neural networks, Bayesian optimization for hyperparameter tuning, and probabilistic programming frameworks like PyMC and Stan.