liveBook · Manning

Categorical distribution

A categorical distribution is a discrete probability distribution over a finite set of mutually exclusive categories or outcomes.

How 3 Manning books explain it

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 →

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.

Read how Causal AI explains categorical distribution →

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 →

Related concepts

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.