A categorical distribution models one trial in which exactly one of several mutually exclusive and exhaustive classes occurs. With class probabilities π₁, …, πₘ, each probability is nonnegative and their sum is 1. It is the single-trial case of the multinomial distribution and extends Bernoulli beyond two classes. section 5.9.6
| p(Ci) = πi |
Use the probability table to map each class Cᵢ to its probability p(Cᵢ) = πᵢ. section 5.9.6
A four-class photo database
A randomly selected photo belongs to one of four classes: Albert Einstein (0.10), Marie Curie (0.42), Carl Friedrich Gauss (0.04), or other (0.44). The probabilities sum to 1 because one and only one class occurs. A Marie Curie outcome can be encoded as the one-hot vector whose Marie Curie position is 1 and every other position is 0. section 5.9.6
Key representations:
- The probability vector describes the possible classes for a single trial. section 5.9.6
- A one-hot vector has m elements, exactly one equal to 1, and all others equal to 0. section 5.9.6
- Each individual class indicator follows a Bernoulli distribution, while the complete outcome represents the categorical distribution. section 5.9.6


