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 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 classes, so use softmax with cross-entropy and predict the arg max. Multilabel: any subset of labels, so use independent sigmoids with binary cross-entropy and predict each label by thresholding.
Steps
- Multiclass example: a digit is exactly one of 0–9. Multilabel example: a news article can be tagged 'politics' and 'economy' at once.
- Multiclass: the raw scores (logits) pass through softmax so probabilities sum to 1. For true class , the cross-entropy loss is , and we predict .
- Multilabel: each output uses the logistic sigmoid independently. With binary target , the binary cross-entropy loss is , and we predict label if (or a tuned threshold).
- Binary relevance: train one binary classifier per label. It is simple but ignores label correlations.
- Classifier chains: train the classifiers in order and feed earlier labels' predictions as extra features for later ones, so correlations are used.
- Label powerset: treat every distinct label combination as one class. It captures correlations but can need up to classes and most are rare.
Common mistakes
- Using softmax for multilabel. It forces the probabilities to compete and sum to 1.
- Using a threshold of 0.5 for all labels even when some labels are rare.
- Forgetting that label powerset can create classes with very few examples.
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 and . What are the hinge loss and the 0–1 loss on the points with label , with label , and with label ?
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?