AI engineering glossary · Evaluation metrics
What is hamming loss?
Hamming loss: For multi-label classification, the fraction of individual label slots that are predicted wrongly, averaged over all examples and labels. It counts each wrong label separately instead of demanding that the whole label set match, so it is more lenient than exact-match accuracy.
Hamming loss: an example
4 news articles each have 5 possible topic tags. If 3 of the 20 tag decisions are wrong, Hamming loss = 3 / 20 = 0.15.
Related terms
More Evaluation metrics terms
- Hit rate
- Human evaluation
- Isotonic calibration
- Jaccard index
- Kendall's tau
- Kolmogorov-Smirnov statistic
- Krippendorff's alpha
- Likelihood ratio
Where you learn it
Hamming loss is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.