Generalized linear models

Linear regression, logistic regression and Poisson regression are one model with three costumes. Meet the exponential family, link functions and deviance, fit any of them with the same algorithm, learn when counts and rates need their own model — and finish with a guide to choosing among every method in this part.

45 min

After this lesson you can

  • Write the Gaussian, Bernoulli and Poisson distributions in exponential-family form, and read off their mean and variance from the log-partition function
  • Define a GLM by its three parts — family, linear predictor, link — and identify the canonical link
  • Derive the GLM log-likelihood gradient and the IRLS fitting algorithm
  • Compute and interpret deviance, and model counts per unit of exposure with a log offset
  • Choose among k-NN, naive Bayes, trees, forests, boosting, kernel methods and GLMs for a new problem, and justify the choice

In this lesson

  1. One family of distributions
  2. Three ingredients
  3. Fitting: one gradient, one algorithm
  4. Choose a family, choose a link
  5. Deviance: the GLM’s residual sum of squares
  6. Counts per unit of time: exposure and offsets
  7. In code
  8. Choosing among the methods of this part

This lesson is part of Descent Pro

Descent Pro unlocks every lesson on the route, from base camp to the summit. Every plan starts with a free trial.

Descent Pro

Start your free trial to keep reading

This lesson, and every other lesson on the route, is part of Descent Pro. Every plan starts with a free trial, and students with a .edu email get longer. Cancel before the trial ends and you pay nothing.