A conditional probability table (CPT) maps each combination of parent-variable values to a probability distribution over a categorical variable. In a causal graphical model, it implements a causal Markov kernel such as P(T|O,R): each lookup returns a probability mass, and the outcomes for a fixed parent combination sum to 1. A variable without parents uses an ordinary probability table instead. section 3.1.8
Use a CPT to represent either learned uncertainty or deterministic assignment logic:
- Learn its entries from categorical data; pgmpy’s fit method estimates parameters from class proportions and exposes them as TabularCPD objects. section 3.1.8
- Encode a deterministic rule with 0 and 1 entries, so every parent configuration assigns exactly one outcome probability 1. section 6.3.3
- Treat impossible parent combinations carefully: lookup tables may leave them blank, but TabularCPD requires assigned values for those cells. section 6.3.3
Transportation choice
For transportation T with occupation O and residence R as parents, a table entry gives a probability such as P(T=car|O=emp,R=big)=0.7034. The car, other, and train probabilities in that parent column sum to 1. The table is learned from survey data and used as one kernel in a Bayesian network. section 3.1.8
