Skip to content
mlmentorship

Probability distributions used in ML

Choose a distribution from the data type and generation process. Connect its support, parameters, mean, variance, likelihood, and common ML use.

Published · 7 min read ·Core ·Foundation

Visual quick review

Visual first · depth when needed

Choose among Bernoulli, binomial, Poisson, and exponential models by defining what one observation records.

Preparing the visual…

Summary

Choose a probability distribution from the values that can occur and the process that generates them. The support rules out impossible values. The parameters describe location, spread, rate, or class probabilities. The likelihood then gives a training objective.

Binary outcomes suggest Bernoulli models. Counts often suggest binomial or Poisson models. Real-valued residuals may support Gaussian or Laplace assumptions. Probabilities and class mixtures often use Beta or Dirichlet distributions.

A practical selection rule

Ask five questions:

  1. Is the value binary, categorical, a count, positive, bounded, or real-valued?
  2. Is one observation a single trial, a total over trials, or a waiting time?
  3. Are events independent at the chosen unit?
  4. Does variance grow with the mean?
  5. Do the tails and zero frequency match the proposed model?

A familiar distribution with wrong support is already wrong. A Gaussian model can assign negative probability to a quantity that must be positive. A Poisson model cannot represent count data whose variance is far above its mean without an extension.

Learning objective

Choose among Bernoulli, binomial, Poisson, and exponential models by defining what one observation records.

Observation units select different distributions for trial and time processes The first panel starts with five independent visits that share conversion probability p and have outcomes one, zero, one, zero, zero. Recording one visit gives a binary value with support zero or one and a Bernoulli p model. Recording the total from all five visits gives a count with support zero through five and a binomial five comma p model. The second panel starts with a constant-rate independent event process marked by three events on a timeline. Recording the number in a ten-minute window gives a nonnegative integer and a Poisson ten lambda model. Recording the time until the next event gives a nonnegative real value and an exponential lambda model. Numbered choices, explicit supports, process assumptions, distinct box outlines, and arrows communicate the selection without relying on color. A · Trial process: independent visits, same p five visit outcomes 1 0 1 0 0 1 · Record one visit X ∈ {0, 1} Bernoulli(p) one binary outcome 2 · Total five visits S ∈ {0, 1, …, 5} Binomial(5, p) success count B · Events: independent, constant rate λ 0 min 10 min three event times 3 · Count in window K ∈ {0, 1, 2, …} Poisson(10λ) events per 10 min 4 · Wait to next event T ∈ [0, ∞) Exponential(λ) continuous duration
Read it this way: choose the process first, then draw a box around exactly what one training row records. For repeated visits with the same independent success probability, one outcome is Bernoulli while a fixed-size total is binomial. For independent constant-rate events, a fixed-time count is Poisson while the wait to the next event is exponential. The distribution follows the observation unit and assumptions, not the noun “conversion” or “arrival.”

Original process-and-observation construction checked against the open OpenStax binomial, Poisson, and exponential textbook sections and the NIST Poisson reference.

Bernoulli and binomial

A Bernoulli variable has

Its mean is and variance is . Binary cross-entropy is the negative Bernoulli log-likelihood.

A binomial variable counts successes in independent Bernoulli trials with the same probability :

Use Bernoulli for one conversion and binomial for the number of conversions among a fixed number of comparable opportunities. Dependence, changing probabilities, or varying exposure can break the binomial assumptions.

Categorical and multinomial

A categorical variable selects one of classes with probabilities . Softmax cross-entropy is the negative categorical log-likelihood.

A multinomial variable counts how often each class appears across categorical trials. The counts sum to .

Use categorical models for one label and multinomial models for a vector of class counts. A multi-label problem is different because several labels can be true at once.

Gaussian and Laplace

A Gaussian variable has support over the real line:

It is a common model for accumulated noise and averages. Maximizing a Gaussian likelihood with fixed variance gives mean squared error.

A Laplace distribution has sharper center mass and heavier tails than a Gaussian. Maximizing a Laplace likelihood with fixed scale gives mean absolute error.

This connection turns loss selection into a noise-model choice:

Residual modelTraining lossMain behavior
Gaussiansquared errorlarge errors receive strong weight
Laplaceabsolute errorless sensitive to large errors

Inspect residuals instead of assuming either model from habit.

Poisson and negative binomial

A Poisson variable models a count in a fixed exposure interval:

Its mean and variance both equal . A log link is common in regression because it keeps the predicted rate positive.

Real counts often have variance above the mean. This is overdispersion. A negative-binomial model adds dispersion and is often a better fit for clicks, incidents, or purchases with heterogeneous rates.

Always include exposure. Ten failures in one hour and ten failures in one month do not imply the same rate.

Exponential and Gamma

The exponential distribution models a positive waiting time under a constant event rate. It is memoryless:

Use it when a constant hazard is defensible. It fails when risk changes with elapsed time.

The Gamma distribution models positive values and includes the exponential as a special case. It can represent waiting time until several events or positive right-skewed quantities.

Beta and Dirichlet

A Beta distribution has support on and two positive shape parameters. It is a convenient prior for a Bernoulli probability:

After observing successes and failures, the posterior is

The Dirichlet distribution generalizes this idea to a vector of class probabilities. It is conjugate to the categorical and multinomial likelihoods.

Conjugacy means the posterior stays in the same distribution family. It gives simple updates, but it is a computational convenience rather than proof that the prior fits the problem.

Worked example

A product records 20 conversions among 500 independent visits. A binomial likelihood fits the fixed-trial count. With a prior, the posterior conversion probability is

If visits come from repeated users with correlated behavior, the independent-trial assumption fails. The uncertainty must account for user groups.

In an interview

For any proposed distribution, state:

  1. Its support.
  2. What one observation represents.
  3. Its parameters and mean-variance relation.
  4. The likelihood or loss it implies.
  5. The assumption most likely to fail.
  6. A diagnostic or alternative model.

A strong answer chooses a distribution after defining the data unit. It does not list distribution names without a generative story.

Common mistakes

  • Using Bernoulli and binomial interchangeably.
  • Using Poisson without checking overdispersion or exposure.
  • Treating softmax as a multi-label model.
  • Using a Gaussian for strongly positive, right-skewed data without checking residuals.
  • Calling conjugacy evidence that a model is true.
  • Ignoring dependence among observations.

Practice next

Connect distribution choice to maximum likelihood estimation, the exponential family, and loss-function selection.