EasyDeepLearn

What is top-k accuracy and when do you use it?

easy

Answer

  • Top-k counts a prediction as correct if the true class is among the top-k predicted classes ranked by score.
  • Common in image classification with many classes (ImageNet top-5), recommender systems (was the right item in the top-10 recommendations?), and retrieval-style tasks.
  • Top-k relaxes the single-choice requirement — appropriate when downstream UX shows multiple candidates.
  • Report both top-1 and top-k for calibration between raw and forgiving evaluation.
Check yourself — multiple choice
  • Top-k means only k classes are used
  • Correct if the true label is among the top-k predicted classes — useful for many-class or recommender tasks
  • Same as accuracy
  • Only for regression

Top-k = true class in top-k predictions. Useful when downstream UX shows a shortlist.

#metrics#classification#multiclass

Practise Supervised Learning

215 interview questions in this topic.

Related questions