Recall & Review
beginner
What is Top-K accuracy in machine learning?
Top-K accuracy measures if the correct answer is among the model's top K guesses. For example, Top-3 accuracy checks if the true label is in the top 3 predicted labels.
Click to reveal answer
beginner
Why is Top-K accuracy useful in computer vision tasks?
Because some images can be ambiguous or have multiple possible labels, Top-K accuracy gives a more forgiving measure by checking if the correct label is within the top guesses, not just the top one.
Click to reveal answer
intermediate
How do you calculate Top-5 accuracy for a classification model?
For each image, check if the true label is in the model's 5 highest probability predictions. The Top-5 accuracy is the percentage of images where this is true.
Click to reveal answer
intermediate
Code snippet: What does this Python code do?
preds = [[0.1, 0.7, 0.2], [0.3, 0.4, 0.3]]
true_labels = [1, 0]
# Calculate Top-2 accuracy
This code checks if the true label is in the top 2 predicted probabilities for each example. It counts how many times this is true and divides by total examples to get Top-2 accuracy.
Click to reveal answer
beginner
What is the difference between Top-1 accuracy and Top-K accuracy?
Top-1 accuracy checks if the model's single highest prediction matches the true label. Top-K accuracy checks if the true label is within the top K predictions, allowing more chances to be correct.
Click to reveal answer
What does Top-3 accuracy measure?
✗ Incorrect
Top-3 accuracy checks if the correct label is within the model's top 3 guesses.
Why might Top-K accuracy be preferred over Top-1 accuracy?
✗ Incorrect
Top-K accuracy is useful when multiple guesses are acceptable, reflecting model performance better in ambiguous cases.
In Top-5 accuracy, what does the number 5 represent?
✗ Incorrect
The 5 means the model's top 5 predicted labels are checked to see if the true label is among them.
If a model has 90% Top-1 accuracy and 98% Top-5 accuracy, what does this mean?
✗ Incorrect
Higher Top-5 accuracy means the true label is usually within the top 5 predictions, even if not the top one.
Which scenario best suits using Top-K accuracy?
✗ Incorrect
Top-K accuracy is useful when multiple possible answers are acceptable or close in meaning.
Explain what Top-K accuracy is and why it is important in evaluating classification models.
Think about how checking multiple top guesses helps understand model performance better.
You got /3 concepts.
Describe how you would calculate Top-3 accuracy for a model's predictions on a test set.
Focus on comparing true labels with the model's top 3 predicted labels.
You got /3 concepts.