Multiclass Logistic Regression

Softmax Function

Generalizes logistic regression to multiple classes:

Where:

  • for class k
  • K = number of classes

Properties:

  • Outputs sum to 1
  • All outputs are positive
  • Can be interpreted as probabilities

Multiclass Cost Function

Categorical Cross-Entropy Loss:

Where is 1 if sample i belongs to class k, else 0 (one-hot encoding).

One-vs-Rest (OvR)

Alternative approach for multiclass:

  • Train K binary classifiers
  • Each classifier: class k vs all other classes
  • Predict class with highest probability

One-vs-One (OvO)

Another multiclass approach:

  • Train binary classifiers
  • Each classifier: class i vs class j
  • Use voting to determine final class