Purpose

Sets up the probabilistic framing for classification and defines the multinomial logistic regression model. This extends the classification framework with a discriminative linear model, and feedforward neural networks generalize it further with nonlinear layers. Training, gradients, and regularization are still missing from this note.

Classification setup

The input can be anything (a document, an image) and the output is a class label from a finite set :

is the vocabulary, so is the set of all possible texts.

is a random variable over inputs, taking values in . is a random variable over outputs, taking values in .

is the true distribution of labeled texts, and is the marginal distribution of labels. We don’t know either without looking at data.

The model

Multinomial logistic regression scores each class with a linear function of features, then normalizes the scores into a distribution with softmax. With a feature vector and per-class weights :

Prediction takes the argmax over classes. The model is discriminative. It estimates directly, while Naive Bayes models the joint through a generative story about how documents arise.

Training maximizes the conditional log-likelihood of the labeled data, which is the same as minimizing cross-entropy loss. See SLP3 for the gradient derivation this note still needs.

Sources