Question bank › IB Computer Science › Theme A – Concepts of computer science

A4 Machine learning (HL-heavy)

Answer on paper first, then reveal the mark scheme one mark at a time.

1Core3 marks

Describe the difference between supervised, unsupervised and reinforcement learning. [3]

2HardHL only4 marks

A k-nearest neighbours classifier (k = 3, Euclidean distance) is trained on the data below.

PointxyClass
P112A
P223A
P331B
P465B
P556B
P620A

Determine the class that this classifier assigns to the new point (3, 3). Show the distances you calculate. [4]

3StandardHL only4 marks

A machine learning model achieves 99% accuracy on its training data but only 71% accuracy on new, unseen data.

(a) Identify the problem with this model. [1]

(b) Explain why this problem occurs. [1]

(c) Suggest two ways to reduce this problem. [2]

4HardHL only5 marks

A classifier for a disease was tested on 200 patients. 60 patients had the disease: of these, 40 were correctly identified (TP) and 20 were missed (FN). Of the 140 healthy patients, 10 were wrongly flagged (FP) and 130 were correctly cleared (TN).

(a) Calculate accuracy, precision and recall. [3]

(b) A classifier that predicts 'healthy' for everyone achieves 70% accuracy on this sample. Explain why accuracy alone is a poor measure here and which measure is most important for this application. [2]

5StandardHL only4 marks

A single artificial neuron has weights w1 = 0.5, w2 = −0.4, w3 = 0.3 and bias b = −0.6. It uses a step activation: output 1 if the total is > 0, otherwise 0.

(a) Calculate the output for inputs (1, 0, 1). [3]

(b) State the output for inputs (0, 1, 1). [1]

6HardHL only5 marks

A school uses linear regression to predict a student's final exam score, y (%), from the number of hours of revision, x. The training data came from students who revised for between 5 and 40 hours. The fitted model is

$$\hat{y} = 1.6x + 28 \qquad r^2 = 0.72$$

(a) Calculate the predicted score for a student who revises for 25 hours. [1]

(b) Explain what the slope and the intercept of this model mean in this context. [2]

(c) Interpret the value r2 = 0.72. [1]

(d) The model predicts a score of 124% for a student who revises for 60 hours. Explain why this prediction is unreliable. [1]

7Standard3 marks

A company trains a recruitment-screening model on ten years of its past hiring decisions. Explain one ethical concern with this approach and suggest one way to reduce it. [3]

Still losing marks on this topic?

Book a free introductory session and we'll find exactly which step is costing you.

Book a free intro