top-k accuracy
The percentage of times that a "target label" appears within the first k positions of generated lists.
Plain English Explanation
The percentage of times that a "target label" appears within the first k positions of generated lists. The lists could be personalized recommendations or a list of items ordered by softmax. Top-k accuracy is also known as accuracy at k.
Consider a machine learning system that uses softmax to identify tree probabilities based on a picture of tree leaves. The following table shows output lists generated from five input tree pictures. Each row contains a target label and the five most likely trees. For example, when the target label was maple, the machine learning model identified elm as the most likely tree, oak as the second most likely tree, and so on. 2 5 | --- --- | oak poplar | dogwood maple | basswood linden | paw-paw poplar | linden paw-paw | The target label appears in the first position only once, so the top-1 accuracy is:
The target label appears in one of the top three positions four times, so the top-3 accuracy is:
How is it used?
Practitioners refer to top-k accuracy when building, training, or evaluating machine learning systems. It appears in research papers, product documentation, and technical discussions about AI capabilities and limitations.