MIT 18.650 — Lecture 25
Logistic Regression
We now switch from linear regression to logistic regression. The only difference is that the response variable now takes on a binary value: .
Definition. Given data , with and , our logistic regression model will be:
Note that is the sigmoid function, pictured below.

Note that the output of our regression model is not an estimate of the response, but rather an estimate of the probability that the response is equal to .
Remark. Another commonly-used model is the probit regression model, described below:
An equivalent representation of the above model is:
Not much is special about , either. Any function can replace the sigmoid function , so long as:
§ MLE for Logistic Regression
Unfortunately, there is no closed-form expression for the MLE of logistic regression. But we can still do our best to try to approximate the log-likelihood-maximizer using gradient ascent.
Theorem. (Logistic Likelihood) The log-likelihood function for logistic regression is:
Proof: Recalling that , the log likelihood is just
And that's the furthest simplification can take us.
The upside is that the log likelihood is concave (proof omitted), so plain gradient ascent should work.
§ Multiclass Classification
A natural generalization of a binary response is a multiclass response .
The result of a multiclass logistic regression is a collection of parameters . These parameters collectively decide the behavior of probability functions , where .
Remark. Check that this description is consistent with binary-classification logistic regression when .
Also note that there are parameters, yet probability functions; this is because the probability functions are constrained by the requirement that for all .
So how exactly do the parameters relate to the probabilities in multiclass logistic regression?
Definition. Given data , with and , our multiclass logistic regression model will be:
Remark. It turns out that the log likelihood in multiclass logistic regression is the negative of the cross entropy loss from machine learning. (18.650 does not elaborate on this any further.)