Back to the 2026 paper

Module 1: Introduction

20267m

A test is applied to 1000 patients: 200 are sick, and 800 are healthy. It correctly detects 160 sick patients, while 40 healthy patients test positive. Construct the confusion matrix and calculate accuracy, precision, recall, and F1-score.

Worked SolutionAI Assisted

Confusion matrix and metrics

There are 200 sick patients and 800 healthy patients. True positives = 160; false negatives = 200 − 160 = 40. False positives = 40; true negatives = 800 − 40 = 760.

Actual / Predicted Positive Negative Total
Sick TP = 160 FN = 40 200
Healthy FP = 40 TN = 760 800
Total 200 800 1000
  • Accuracy = ((TP+TN)/N=(160+760)/1000=\mathbf{92%})
  • Precision = (TP/(TP+FP)=160/200=\mathbf{80%})
  • Recall = (TP/(TP+FN)=160/200=\mathbf{80%})
  • F1 = (2PR/(P+R)=\mathbf{80%})

Accuracy measures overall correctness; precision measures reliability of positive predictions; recall measures how many actual sick patients were detected.

Similar questions

MACHINE LEARNINGSuppose 10000 patients are tested for flu; out of them, 9000 are actually healthy and 1000 are actually sick. For the sick people, a test was positive for 620 and negative for 380. For the healthy people, the same test was positive for 180 and negative for 8820. Construct a confusion matrix.20254mMACHINE LEARNINGA patient takes a lab test and the result comes back positive. It is known that the test returns a correct positive result in only 98% of the cases and a correct negative result in only 97% of the cases. Furthermore, only 0.008 of the entire population has this disease. (i) What is the probability that this patient has cancer? (ii) What is the probability that he does not have cancer? (iii) What is the diagnosis?20237mMACHINE LEARNINGDescribe the evaluation metrics used in machine learning, such as accuracy, precision, recall, and F1-score, with a numerical example. Explain the importance of cross-validation in estimating a model's generalization performance.20257mData MiningThe results of an exam are recorded along with some data about the students. The results can be found in the table below : | ID | Cell No. | Language | Passed all Assignments | GPA | Passed Exam | | :---: | :---: | :---: | :---: | :---: | :---: | | 1 | 93333-11101 | Java | No | 3.1 | Yes | | 2 | 93333-11112 | Java | No | 2.0 | No | | 3 | 93333-11102 | C++ | Yes | 3.5 | Yes | | 4 | 93333-11113 | Python | Yes | 2.5 | Yes | | 5 | 93333-11103 | Java | Yes | 3.9 | No | | 6 | 93333-11114 | C++ | No | 2.9 | No | | 7 | 93333-11104 | Java | No | 1.9 | No | | 8 | 93333-11115 | Python | Yes | 3.2 | Yes | In no more than one page of text, describe the design of a K-Nearest Neighbour classifier to predict if a student will fail or pass the exam.202110m
AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.