AI Glossary / Probabilistic machine learning / Intermediate
Binomial regression
Definition
Binomial regression models how explanatory variables relate to the probability of a two-outcome event, using a binomial distribution for the observed number of events in a known number of trials. For example, it can model completed registrations out of attempted registrations. Logistic regression is a common form, but other link functions are possible.
What it means
The key information is a numerator and a denominator: how many events occurred, and how many opportunities there were. Ten completed registrations out of twenty attempts convey different information from ten out of two hundred.
For group i, the model assumes a count Y_i distributed as Binomial(n_i, p_i). The number of trials n_i is known, while the event probability p_i depends on the group's explanatory variables.
When each observation contains one trial, n_i = 1, the response is binary and the distribution is Bernoulli. Grouped binomial data combine trials that share the modeled probability. Grouping should not silently discard important differences in their explanatory variables.
How it works
Define the event consistently and record its count together with the number of trials. Select predictors that are available at the time the prediction will be used.
A link function connects the event probability to a linear predictor. With the logit link, log(p / (1 − p)) = beta_0 + beta_1 x_1 + other predictor terms. Applying the inverse link converts this value back into a probability between zero and one.
Estimate the coefficients from the data, commonly through likelihood-based fitting, and assess predictions on relevant held-out observations. The expected count for a group is n × p, while the binomial count variance is n × p × (1 − p).
The standard model assumes conditionally independent trials with a shared probability within each group. Extra dependence or unmodeled variation can make the observed variability exceed that binomial expectation and require a different treatment.
Three practical examples
- A service team models the proportion of appointments attended out of appointments scheduled, using appropriate predictors and clearly defined observation periods.
- A software team models successful test executions out of a fixed number of executions under comparable conditions.
- An operations analyst models the number of inspected items passing a specified check, keeping the inspected total for each group.
Think of it this way
Think of predicting how many green counters will be drawn in a series of independent draws with replacement. The number of draws matters, and the chance of green may differ between jars.
The analogy stops short of explaining why real outcomes differ. People or machines can share circumstances, and their outcomes may be dependent. Regression predictors and model checks are needed to judge whether the assumed trial structure is reasonable.
Worked example
Use an original hypothetical logistic model with a single binary predictor x. Let the intercept be log(1/4), and the coefficient of x be log(2). These are stipulated values, not estimates from an actual dataset.
At x = 0, the odds are exp(log(1/4)) = 1/4, so the probability is (1/4) / (1 + 1/4) = 0.2. For twenty trials, the expected count is 20 × 0.2 = 4, and the binomial variance is 20 × 0.2 × 0.8 = 3.2.
At x = 1, the odds double to 1/2. The probability becomes (1/2) / (1 + 1/2) = 1/3, and the expected count among twenty trials is 20/3, approximately 6.67.
Doubling the odds therefore does not double the probability. The fractional expected count is an average over hypothetical repetitions; a realized count is still an integer. Nothing in this calculation establishes that changing x would cause the predicted difference.
Illustrative case study
In a fictional project, Meadow Training compares completion counts across course sessions. One session has eight completions out of ten enrollments, while another has eighty out of one hundred.
The observed proportions are both 80%, but the analyst retains the denominators and checks whether participants within a session share circumstances that create dependence. The team also asks whether grouping has hidden differences in course format and participant experience.
This case illustrates model specification and data representation. It does not report a fitted effect or a demonstrated improvement in completion rates.
Common misconceptions and mistakes
Do not model a count without its trial total when the outcome is successes out of known opportunities.
Do not assume that every percentage is binomial. A percentage of a continuous quantity may not arise from countable binary trials.
Do not confuse a logit coefficient with a percentage-point change. Its direct interpretation concerns log-odds, and exp(beta) gives an odds ratio under the stated model.
Do not confuse binomial regression with negative binomial regression, which serves a different count-modeling purpose.
Finally, do not treat statistical association as a causal effect or assume independence merely because each record occupies a separate spreadsheet row.
Business use
For business analysis, binomial regression provides a coherent way to relate event rates to predictors while retaining the number of opportunities behind each rate. It can support forecasting and comparisons when its assumptions match the process.
Report predicted probabilities and expected counts with their denominators and appropriate uncertainty. Check calibration and variation across relevant groups. If observations are clustered or substantially more variable than expected, revisit the model before relying on narrow uncertainty intervals. The usefulness comes from a defensible representation of the process, not simply from choosing a familiar regression name.
People also ask
Is binomial regression always logistic regression?
No. Logistic regression uses the logit link; binomial models can use other appropriate links.
Can the denominator differ across rows?
Yes. Each group can have its own known number of trials.
Can the predicted number of events be fractional?
The expected count can be fractional, while an actual observed count must be an integer from zero through the trial total.
Check your understanding
A group contains fifty trials and has predicted event probability 0.3. What is its expected event count, and is that a guarantee?
Answer: The expected count is 50 × 0.3 = 15. It is a model expectation, not a promise that exactly fifteen events will occur.
Related terms
- Binomial distribution
- Generalized linear model
- Logistic regression
- Odds ratio
- Bernoulli distribution
- link function
- overdispersion
Learn next
convert several probabilities to odds and back. Then compare grouped success/failure counts with their proportions, checking how the trial denominator changes the information available for estimation.
More in Probabilistic machine learning
- Bernoulli mixture model - A Bernoulli mixture model represents binary observations as coming from a mixture of hidden components.
- Beta-binomial model - A beta-binomial model combines a binomial model for a count of successes with a beta distribution for the underlying success probability.
- Bi-tempered loss - Bi-tempered loss is a generalization of logistic classification loss that uses two temperature parameters: one changes how prediction errors are penalized...
- Black-box variational inference - Black-box variational inference is an approach to approximate Bayesian inference that estimates optimization gradients through sampling, reducing the need...
- Blind inverse problem - A blind inverse problem seeks to recover an underlying signal or object when the process that produced the measurements is also partly or wholly unknown.
- Blocked Gibbs sampling - Blocked Gibbs sampling is a Markov chain Monte Carlo method that updates a group of variables together from their joint conditional distribution, given the...
Sources
Primary documentation: statsmodels, Binomial family and supported response representations: https://www.statsmodels.org/stable/generated/statsmodels.genmod.families.family.Binomial.html statsmodels, generalized linear model distributions and moments: https://www.statsmodels.org/stable/glm.html The coefficients, examples, and fictional case are original illustrations.
Previous: Binomial distribution Next: Binomial test