liveBook · Manning

Link function

As explained in Ensemble Methods for Machine Learning

A link function connects the expected value of a response distribution to a linear predictor in a generalized linear model.

A link function lets a linear predictor handle targets that do not behave like ordinary continuous values. Rather than model a count or class label directly as β₀ + β′x, it transforms the target scale: g(y) = β₀ + β′x. Choosing g changes how linear feature effects become predictions on the original scale. section 7.1.2 section 7.1.4

The choice follows the target’s distribution and the application. For count labels, the log link gives log(y) = β₀ + β′x, or y = e^(β₀ + β′x), matching an exponential mean trend with a Poisson distribution. For binary labels, the logit link transforms a probability into log-odds; inverting it produces the sigmoid used by logistic regression. section 7.1.2 section 7.1.3

Table 7.2 GLMs for different types of labels (view table figure)

Model

Link function

Distribution

Type of label

Linear regression

Identity

g(y) = y

Normal

Real-valued

Gamma regression

Negative inverse g(y) = -(1/y)

Gamma

Positive real-valued

Poisson regression

Log g(y) = log(y)

Poisson

Counts/occurrences; integer-valued

Logistic regression

Logit g(y) = (y/(1-y))

Bernoulli

0-1; binary class labels; yes/no outcomes

Multiclass logistic regression

Multiclass logit g(y) = (y/(K-y))

Binomial

0-K; multiclass labels; multichoice outcomes

Tweedie regression

Log g(y) = ln(y)

Tweedie

Labels with many zeros, right-skewed targets

Compare link–distribution pairs before selecting a generalized linear model: identity with normal targets, log with counts, and logit with binary labels are central examples. section 7.1.4

A generalized linear model combines four pieces:

  • A probability distribution for the target, such as normal, Poisson, or Bernoulli. section 7.1.4
  • A linear predictor η = β₀ + β′x, plus a link function g(y) = η. section 7.1.4
  • A regularization function R(β) when coefficient control is needed. section 7.1.4

Reading logistic-regression effects

For diabetes classification, logistic regression models the log-odds of a positive diagnosis as a weighted sum of age and blood-glucose features. Increasing a feature shifts log-odds by its coefficient; exponentiating that shift expresses the corresponding change in odds. This preserves a linear, additive explanation while predicting class probabilities. section 9.1.3

Links also carry GLM intuition into nonlinear ensembles. For bike-sharing targets with many zeros and a right-skewed positive tail, a log link is suggested for a GLM; LightGBM and XGBoost can support link functions and distributions including Poisson, gamma, and Tweedie while learning beyond linear models. section 7.4.1

How Ensemble Methods for Machine Learning covers it

How deep it goes
Explains log and logit links through inverse transformations, odds, and GLM components without deriving their estimation procedures.
Examples
Uses count-valued targets, binary class labels, diabetes diagnosis, and bike-sharing demand to illustrate link choices.
What it assumes
Builds from linear regression while introducing count distributions, binary labels, sigmoid functions, odds, and log-odds.
What you can do after
Evaluate/understand which link–distribution pairing suits continuous, count, binary, multiclass, or zero-heavy targets.
How it connects
Connects generalized linear models with linear regression, Poisson regression, logistic regression, probability distributions, regularization, and gradient boosting.

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.