liveBook · Manning

Logit

As explained in Ensemble Methods for Machine Learning

Log-odds are the natural logarithm of the odds of an event.

A logit turns an event’s odds into a number that can be modeled additively. Odds compare an outcome with its alternative; the logit is their natural logarithm, or log-odds. In binary classification, this creates a bridge between a linear score and a probability. section 7.1.3

For a probability p, the odds are p/(1 − p), and the logit is log(p/(1 − p)). A logistic regression model sets this quantity equal to β₀ + β′x. Applying the inverse link gives p = 1/(1 + e⁻⁽ᵝ⁰ ⁺ ᵝ′ˣ⁾), the sigmoid function. The linear expression therefore controls how likely either binary class is. section 7.1.3

Reading a coefficient as an odds change

Suppose a diabetes model assigns age a weight of 0.5. Increasing age by one raises the log-odds of a positive diagnosis by 0.5 and multiplies the odds by e⁰·⁵ = 1.65, or 65% more. A glucose weight of −0.29 instead multiplies the odds by e⁻⁰·²⁹ ≈ 0.75, or 25% less. Positive weights increase the modeled odds, negative weights decrease them, and zero weights leave them unchanged. section 9.1.3

This interpretation makes logistic regression useful when feature contributions need to remain visible. Its linear and additive structure expresses the log-odds as individual weighted contributions, while the Bernoulli distribution supplies the yes/no outcome model. section 7.1.3 section 9.1.3

A practical workflow applies the idea to a classification model:

  • Standardize the breast-cancer features, split the data, and fit scikit-learn’s LogisticRegression classifier. section 9.1.3
  • Exponentiate learned coefficients to view multiplicative changes in odds, then compare positive, negative, and zero contributions. section 9.1.3
Figure 7.5 Logistic regression (left) fits 0/1-valued targets by assuming that the spread of the targets can be modeled by the discrete-valued Bernoulli distribution (right). Observe how the prediction probabilities (the heights of the bars) of Class 0 and Class 1 change with the data.
CH07_F05_Kunapuli

Visualize how the sigmoid maps one feature to changing class probabilities while the Bernoulli distribution represents the binary outcomes. section 7.1.3

How Ensemble Methods for Machine Learning covers it

How deep it goes
Defines odds and log-odds, derives the inverse link, and interprets coefficients but does not develop estimation theory.
Examples
Uses diabetes diagnosis coefficients and a breast-cancer classifier with standardized image-derived features.
What it assumes
Assumes familiarity with probability and regression while reinforcing odds, binary labels, and the Bernoulli model.
What you can do after
Evaluate and understand how logistic-regression coefficients change class odds.
How it connects
Ties logit to odds, sigmoid function, logistic regression, Bernoulli distribution, and generalized linear models.

Also explained in

Compare how 17 books explain logit →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Ensemble Methods for Machine Learning. The section links point to the parts of the book it draws on.