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.

Level: advancedTopic: Evaluation metrics

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.