Glossary

Top-k Accuracy

What is Top-k Accuracy?

Top-k accuracy measures how often the correct answer is among a model's k most likely suggestions. With top-1 only the first prediction counts; with top-5 it is enough for the correct class to be among the five best, a well-known metric from image recognition benchmarks such as ImageNet. It is useful wherever users see several suggestions, for example product recommendations or autocomplete.

Topics

  • Metric
  • Evaluation
  • Classification

Try KI.ordo

Agents, flows and templates in one workspace – free 24-hour demo.

Start demo
← All terms

Related terms

Confusion Matrix

A confusion matrix is a table that compares a classifier's predictions with the actual classes. For two classes, it shows true positives, false positives, true negatives and false negatives. From this, metrics such as precision, recall and F1 score can be calculated, and it becomes clear which errors occur. Example: a spam filter that flags many genuine emails as spam has many false positives, which is often more costly than a missed spam message.

  • Model evaluation
  • Classification
  • +1

Mean average precision (mAP)

Mean average precision (mAP) is a metric that assesses how well a system finds relevant results and ranks them near the top. Average precision is calculated across the result list for each query or object class; mAP is the mean across all of them. It is a standard measure for search engines, recommender systems and object detection in images, where it also depends on the required overlap of bounding boxes.

  • metric
  • search
  • +1

F-score (F1 score)

The F-score is a metric for evaluating classification models. The common F1 score is the harmonic mean of precision (how many of the predicted hits are correct) and recall (how many of the actual hits were found), and ranges from 0 to 1. It is especially useful with imbalanced data: a spam filter that almost never flags spam can have high accuracy but a low F1 score.

  • Evaluation metric
  • Classification
  • +1

Classifier

A classifier is a model or method that assigns inputs to one of several predefined categories. Classic variants such as decision trees or naive Bayes are trained on labelled examples; language models can also sort texts based on a description of the categories. Typical uses include spam detection, sorting customer enquiries by topic and categorising receipts. Quality is measured with metrics such as accuracy, precision and recall.

  • Classification
  • Machine learning
  • +1
Template