Categorical distribution
A categorical distribution is a discrete probability distribution over a finite set of mutually exclusive categories or outcomes.
Fabulous Adventures in Data Structures and Algorithms
A categorical distribution assigns probabilities to a finite set of mutually exclusive categories.
- How it is used
- Represents weighted finite random choices and supports sampling and later Bayesian calculations.
- How deep it goes
- Develops projected weights and compares four sampling algorithms, including alias construction and its costs.
- Examples
- Uses a color-labeled die, zero-weight histogram, and cold-and-sneezing joint distribution.
- What you can do after
- Build it from scratch in C# with integer weights, or apply `ToCategorical` and `ToJoint` to weighted values.
Read how Fabulous Adventures in Data Structures and Algorithms explains categorical distribution →
Grokking Bayes
A probability distribution over a finite set of mutually exclusive categories with associated probabilities.
- How it is used
- Represents beliefs about which outcome among discrete alternatives will occur, including rainfall amounts and possible parameter values.
- How deep it goes
- Defines categories and probability constraints with examples, but defers continuous probability distributions and greater numerical accuracy.
- Examples
- Uses rainfall amounts, rainfall ranges, and rounded proportion values from 0.0 through 1.0.
- What you can do after
- Apply categorical probabilities to represent beliefs about discrete outcomes and compare uniform, moderate, or strongly weighted assignments.
Applied Reinforcement Learning
A categorical distribution assigns probabilities to a finite set of mutually exclusive outcomes.
- How it is used
- Represents discrete action choices in a policy-gradient agent, complementing Gaussian distributions for continuous actions.
- How deep it goes
- Works through softmax probabilities for three actions and illustrates reinforcement, while focusing the broader treatment on Gaussian policies.
- Examples
- Calculates softmax probabilities for Low, Medium, and High actions, then shows how returns shift their likelihoods.
- What you can do after
- Understand how policy-gradient updates increase the likelihood of good discrete actions and suppress the likelihood of poor ones.
Read how Applied Reinforcement Learning explains categorical distribution →
Causal AI
Categorical is a Pyro distribution object representing a categorical probability distribution.
- How it is used
- Represents discrete outcomes and supplies a Pyro object for randomly generating category indices.
- How deep it goes
- Defines categories, probabilities, discrete notation, and Pyro sampling, but does not develop categorical inference or parameter estimation.
- Examples
- Uses food categories, probabilities [.45, .30, .25], Pyro construction, and sampled indices such as tensor(1.).
- What you can do after
- Apply it via Pyro by constructing a Categorical object with probabilities and calling sample() for random category generation.
Math and Architectures of Deep Learning
A discrete probability distribution over exactly one of several mutually exclusive classes in a single trial.
- How it is used
- Frames single-trial class uncertainty for machine-learning problems involving classification and probability distributions.
- How deep it goes
- Defines class probabilities, relates categorical to Bernoulli and multinomial distributions, and represents outcomes with one-hot vectors.
- Examples
- Uses a four-class photo database containing Einstein, Curie, Gauss, and other-photo outcomes.
- What you can do after
- Evaluate/understand single-trial class probabilities and encode outcomes as one-hot vectors.
Read how Math and Architectures of Deep Learning explains categorical distribution →
Also covered in
What to know first
- probability distributionA probability distribution is a mathematical specification assigning probabilities or probability densities to the possible values or outcomes of a random variable.
- meanThe mean is a measure of central location equal to the arithmetic average of numerical observations, or the probability-weighted average of a random variable’s possible values.
- random variableA random variable is a function that assigns numerical values to outcomes of a random process and is characterized by a probability distribution.
- parameterA parameter is a value or named input that specifies or influences the behavior, computation, or output of a function, model, or system.
Related concepts
- Bernoulli distributionincludes · A Bernoulli distribution is a discrete probability distribution for one binary outcome, assigning probability p to one outcome and 1−p to the other.
- discrete action spaceused by · A discrete action space is a finite set of distinct actions from which an agent selects.
- gumbel-softmaxused by · Gumbel-Softmax is a differentiable approximation that samples from categorical distributions while enabling gradient-based optimization.
- maximum likelihood estimationequivalent to · Maximum likelihood estimation is a statistical method that selects parameter values maximizing the likelihood of observed data under a specified probabilistic model.
- Pointer Networkproduced by · A Pointer Network is an attention-based sequence-to-sequence neural architecture that outputs positions or elements selected from its input sequence.
Questions about categorical distribution
What is categorical distribution?
A categorical distribution is a discrete probability distribution over a finite set of mutually exclusive categories or outcomes.
Which Manning books explain categorical distribution?
Fabulous Adventures in Data Structures and Algorithms, Grokking Bayes, Applied Reinforcement Learning, Causal AI and Math and Architectures of Deep Learning.
What should I know before learning categorical distribution?
Manning books that teach categorical distribution usually introduce probability distribution, mean, random variable and parameter first.
What kinds of categorical distribution are there?
Kinds of categorical distribution include Bernoulli distribution.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




