Sample questions
Question 1Easy
A binary classifier's confusion matrix gives TP = 40, FP = 10, FN = 20, TN = 30. What is its accuracy?
- 0.80
- 0.40
- 0.70
- 0.67
Answer: C. 0.70
Explanation
Accuracy = (TP + TN) / total =
(40 + 30) / 100 = 0.70.
Step-by-step solution
- Accuracy = (TP + TN) / total.
- = (40 + 30) / (40 + 10 + 20 + 30).
- = 70 / 100 = 0.70.
Why the other options are wrong
- A. 0.80 is precision, 40 / 50.
- B. 0.40 uses only TP / total.
- D. 0.67 is recall, 40 / 60.
Question 2Easy
For the confusion matrix TP = 40, FP = 10, FN = 20, TN = 30, what is the precision?
- 0.75
- 0.80
- 0.67
- 0.70
Answer: B. 0.80
Explanation
Precision = TP / (TP + FP) =
40 / 50 = 0.80: of everything predicted positive, 80% really is positive.
Step-by-step solution
- Precision = TP / (TP + FP).
- = 40 / (40 + 10) = 40 / 50.
- = 0.80.
Why the other options are wrong
- A. 0.75 uses no formula from this matrix.
- C. 0.67 is recall, 40 / 60.
- D. 0.70 is accuracy.
Tip: Precision uses the Predicted + column; recall uses the Actual + row.
Question 3Easy
True values are [3, 5, 2] and predictions are [2, 5, 4]. What is the mean absolute error (MAE)?
- 0.5
- 3
- 1
- 1.67
Answer: C. 1
Explanation
Absolute errors: |3-2| = 1, |5-5| = 0, |2-4| = 2.
MAE =
(1 + 0 + 2) / 3 = 1.
Step-by-step solution
- Absolute errors: |3 - 2| = 1, |5 - 5| = 0, |2 - 4| = 2.
- Sum = 3.
- MAE =
3 / 3 = 1.
Why the other options are wrong
- A. 0.5 would need a total error of 1.5.
- B. 3 is the sum of errors, not the mean.
- D. 1.67 is the mean squared error (5 / 3).
Question 4Easy
For a cancer screening test, missing a sick patient is far worse than a false alarm. Which metric should be prioritised?
- Accuracy
- Specificity
- Recall
- Precision
Answer: C. Recall
Explanation
Recall = TP / (TP + FN) measures how many real positives are caught; maximising it minimises false negatives.
Step-by-step solution
- Missing a sick patient is a false negative.
- Recall = TP / (TP + FN) falls when false negatives rise.
- So maximise recall, accepting more false alarms.
Why the other options are wrong
- A. Accuracy can stay high while many sick patients are missed.
- B. Specificity measures how well healthy people are cleared, not how many sick are found.
- D. Precision guards against false alarms, which are the lesser problem here.
Tip: Missing is worse -> recall. False alarm is worse -> precision.
Question 5Easy
What does an ROC-AUC of 0.5 indicate for a binary classifier?
- Performance no better than random guessing
- The model always predicts positive
- The model is correct 50% of the time on positives only
- Perfect classification
Answer: A. Performance no better than random guessing
Explanation
AUC is the probability that a random positive is scored above a random negative. 1.0 is perfect; 0.5 is chance.
Step-by-step solution
- AUC is the area under the ROC curve.
- A random classifier gives the diagonal line, with area 0.5.
- So AUC 0.5 means no ability to separate the classes.
Why the other options are wrong
- B. AUC 0.5 means no separation; it does not say the model always predicts positive.
- C. AUC is not accuracy on positives.
- D. Perfect classification has AUC = 1.0.
Tip: AUC: 0.5 = random, 1.0 = perfect.
Question 6Medium
For the confusion matrix TP = 40, FP = 10, FN = 20, TN = 30, what is the recall?
- 0.70
- 0.80
- 0.57
- 0.67
Answer: D. 0.67
Explanation
Recall = TP / (TP + FN) =
40 / 60 = 0.67: the model finds two-thirds of all actual positives.
Step-by-step solution
- Recall = TP / (TP + FN).
- = 40 / (40 + 20) = 40 / 60.
- = 0.67.
Why the other options are wrong
- A. 0.70 is accuracy.
- B. 0.80 is precision.
- C. 0.57 would be 40 / 70, which mixes up the denominator.
Question 7Medium
A dataset has 990 negative and 10 positive examples. A model that predicts "negative" for everything achieves 99% accuracy. What is its recall on the positive class?
- 50%
- 1%
- 0%
- 99%
Answer: C. 0%
Explanation
It never predicts positive, so TP = 0 and recall =
0 / 10 = 0.
This is why accuracy is misleading on imbalanced data.
Step-by-step solution
- Recall = TP / (TP + FN).
- The model never predicts positive, so TP = 0 and FN = 10.
- Recall = 0 / 10 = 0%.
Why the other options are wrong
- A. No positive is caught, so recall cannot be 50%.
- B. 1% is the share of positives in the data, not recall.
- D. 99% is the accuracy, not recall.
Tip: High accuracy + rare class? Check recall.
Question 8Medium
For the confusion matrix TP = 40, FP = 10, FN = 20, TN = 30, what is the F1 score (to two decimal places)?
- 0.73
- 0.75
- 0.70
- 0.80
Answer: A. 0.73
Explanation
Precision = 0.8, recall = 2/3.
F1 = 2PR / (P + R) =
2 x 0.8 x 0.667 / 1.467 = 0.727, about 0.73.
Step-by-step solution
- Precision =
40 / 50 = 0.80.
- Recall =
40 / 60 = 0.667.
- F1 = 2PR / (P + R) =
2 x 0.8 x 0.667 / 1.467 = 0.727, about 0.73.
Why the other options are wrong
- B. 0.75 is not the harmonic mean of 0.80 and 0.67.
- C. 0.70 is accuracy.
- D. 0.80 is precision alone.
Tip: F1 = 2TP / (2TP + FP + FN) = 80 / 110 = 0.73.
Question 9Hard
Why is k-fold cross-validation preferred over a single train/test split, especially for small datasets?
- It needs less computation than a single split
- Every example gets used for both training and validation
- It removes the need for a final test set in all cases
- It always produces a more accurate final model than training on a single split
Answer: B. Every example gets used for both training and validation
Explanation
The data is split into k folds; each fold serves once as validation while the rest train. Averaging the k scores reduces dependence on one lucky or unlucky split.
Step-by-step solution
- The data is split into k folds.
- Each fold serves once as validation while the others train.
- Every example is used for both training and validation, and scores are averaged.
Why the other options are wrong
- A. It needs k training runs, so it costs more, not less.
- C. A final held-out test set is still good practice.
- D. It gives a more reliable estimate, not a guaranteed better model.
Tip: Cross-validation = better estimate, not a better model.
Question 10Hard
An ROC curve plots which two quantities as the decision threshold varies?
- Training loss against the number of epochs completed
- Accuracy against threshold
- Precision against recall
- True positive rate against false positive rate
Answer: D. True positive rate against false positive rate
Explanation
TPR = TP / (TP + FN) on the y-axis and FPR = FP / (FP + TN) on the x-axis. The precision-recall curve is a different plot, often preferred for heavy class imbalance.
Step-by-step solution
- Each threshold gives one pair of rates.
- The y-axis is true positive rate (recall).
- The x-axis is false positive rate = FP / (FP + TN).
Why the other options are wrong
- A. Loss against epochs is a learning curve.
- B. ROC does not plot accuracy.
- C. Precision against recall is the PR curve.
Practise all 10 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →