The probability of an event occurring given that another event has already occurred.
Conditional probability is a foundational concept in probability theory that quantifies how likely an event A is to occur given that event B has already taken place. Formally written as P(A|B), it is computed as P(A ∩ B) / P(B), provided P(B) > 0. This ratio captures how knowledge of one event reshapes the probability landscape for another, making it a precise mathematical tool for reasoning under uncertainty. When A and B are independent, knowing B provides no information about A and P(A|B) = P(A); when they are dependent, the conditional probability diverges meaningfully from the marginal.
In machine learning, conditional probability is everywhere. Generative classifiers like Naive Bayes model P(class | features) directly. Language models learn P(next token | previous tokens) to generate coherent text. Probabilistic graphical models — Bayesian networks and Markov random fields — are built entirely from conditional probability relationships between variables. Even discriminative models like logistic regression can be interpreted as estimating conditional distributions. The chain rule of probability, which decomposes joint distributions into products of conditionals, underpins how complex probabilistic models are constructed and trained.
The concept also anchors Bayesian inference, where a prior belief P(hypothesis) is updated with observed evidence via Bayes' theorem to yield a posterior P(hypothesis | evidence). This framework is central to probabilistic machine learning, enabling models to quantify uncertainty, incorporate domain knowledge, and update beliefs as new data arrives. Understanding conditional probability is essentially a prerequisite for any serious engagement with probabilistic reasoning, statistical modeling, or modern deep learning theory.