What is the difference between multiclass and multilabel classification, and how do the output activation, the loss and the prediction rule differ for a neural or linear model with L outputs? What are three ways to reduce multilabel to simpler problems?

Supervised learning, Multiclass and multilabel
Level L2 Elementary. Length Medium. Nature Th Theoretical.

What's being asked

Whether you can tell 'exactly one label' from 'any subset of labels' and match the output layer and loss to each.

Key idea

Multiclass: exactly one of K classes, so use softmax with cross-entropy and predict the arg max. Multilabel: any subset of L labels, so use L independent sigmoids with binary cross-entropy and predict each label by thresholding.

Steps

  1. Multiclass example: a digit is exactly one of 0–9. Multilabel example: a news article can be tagged 'politics' and 'economy' at once.
  2. Multiclass: the raw scores (logits) z1,…,zK pass through softmax so probabilities pk=softmax⁡(z)k=ezk/∑jezj sum to 1. For true class y, the cross-entropy loss is −log⁡py, and we predict arg⁡max⁡kpk.
  3. Multilabel: each output uses the logistic sigmoid pl=σ(zl)=1/(1+e−zl) independently. With binary target yl∈{0,1}, the binary cross-entropy loss is −∑l[yllog⁡pl+(1−yl)log⁡(1−pl)], and we predict label l if pl>0.5 (or a tuned threshold).
  4. Binary relevance: train one binary classifier per label. It is simple but ignores label correlations.
  5. Classifier chains: train the classifiers in order and feed earlier labels' predictions as extra features for later ones, so correlations are used.
  6. Label powerset: treat every distinct label combination as one class. It captures correlations but can need up to 2L classes and most are rare.

Common mistakes

How long your answer should be

A short paragraph plus a three-item list; 3–4 minutes.

Read this

Previous in Supervised learning: A linear classifier has w=(2,−1) and b=0.5. What are the hinge loss and the 0–1 loss on the points A=(1,0) with label +1, B=(0,0) with label +1, and C=(1,1) with label −1?
Next in Supervised learning: A node has 10 samples, 6 positive and 4 negative. A split sends 5 samples left (4 positive, 1 negative) and 5 right (2 positive, 3 negative). What is the Gini impurity of the parent and of the two children, and what is the Gini gain of the split?