Multiclass classification
One-vs-rest and the softmax function.
With classes there are two main strategies. One-vs-rest (OvR) trains binary classifiers, each separating one class from all the others, and predicts the class whose classifier is most confident. One-vs-one trains a classifier for every pair and takes a vote.
The direct approach is softmax (multinomial logistic) regression: compute one score per class and turn the scores into probabilities:
Softmax outputs are positive and sum to 1; the biggest score gets the biggest probability, and it is shift-invariant (adding a constant to every score changes nothing). It is trained with categorical cross-entropy, , and it is the final layer of almost every neural-network classifier.
Formula to remember
Logistic model
Probability of the positive class.