Hamming Loss
Hamming Loss (Multi-label Classification) · Also known as: Hamming Distance, Subset Accuracy Loss
Hamming loss measures the fraction of labels that are incorrectly predicted in multi-label classification. It counts the number of label mistakes divided by the total number of labels, providing a simple metric for multi-label problems.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use Hamming loss for multi-label classification where each sample can have multiple labels and you want to penalize individual label errors. It is appropriate for document tagging, image annotation, and multilingual text processing where samples naturally have multiple labels.
Strengths & limitations
- Simple and intuitive: measures fraction of incorrect labels.
- Provides partial credit for partially correct predictions.
- Directly interpretable as an error rate across all labels.
- Computationally efficient.
- Does not distinguish between false positives and false negatives for individual labels.
- Treats all labels as equally important; does not account for label imbalance.
- Does not account for label correlations or hierarchies.
- May be dominated by the most frequent labels in imbalanced multi-label settings.
Frequently asked
How does Hamming loss differ from 0/1 loss (subset accuracy)?
Hamming loss counts individual incorrect labels and averages across all labels. Subset accuracy (0/1 loss) counts a sample as wrong if ANY label is wrong, giving 0/1 credit per sample. Hamming loss gives partial credit and is less strict; subset accuracy is stricter, requiring all labels to be correct for credit.
What is a good Hamming loss value?
It depends on the problem. A Hamming loss of 0.05 or below is usually considered good. However, on multi-label problems with many labels, even random guessing can result in low Hamming loss if most labels are negative. Compare against appropriate baselines (e.g., predicting the most common label for all instances).
Should I use Hamming loss if labels are imbalanced?
Hamming loss treats all labels equally, so it can be dominated by the most frequent labels. For imbalanced multi-label data, consider weighted variants or examine per-label precision and recall separately to ensure minority labels are not ignored.
Sources
- Schapire, R. E., & Singer, Y. (2000). BoosTexter: A boosting-based system for text categorization. Machine Learning, 39(2-3), 135-168. DOI: 10.1023/A:1007649029923 ↗
- Tsoumakas, G., & Katakis, I. (2007). Multi-label classification: An overview. International Journal of Data Warehousing and Mining, 3(3), 1-13. DOI: 10.4018/jdwm.2007070101 ↗
How to cite this page
ScholarGate. (2026, June 3). Hamming Loss (Multi-label Classification). ScholarGate. https://scholargate.app/en/model-evaluation/hamming-loss
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Jaccard IndexModel Evaluation↔ compare