Quiz: Metrics and neural networks
How to use this quiz
Nine exam-style questions on sections 3.3 and 3.4 of the syllabus. Questions 1 to 3 are K3 calculations: in the exam such a question is worth 2 points. Keep a calculator or a piece of paper ready, and answer each question before you open the explanation.
1. (K3) A defect-prediction model is tested on 500 software modules. It flags 80 modules as defective; 60 of them really are defective. In total 100 of the 500 modules are defective. What is the recall?
- A. 0.60
- B. 0.75
- C. 0.80
- D. 0.88
Show answer
2. (K3) Same model as question 1. What is the accuracy?
- A. 0.80
- B. 0.84
- C. 0.88
- D. 0.92
Show answer
3. (K3) A classifier has a precision of 0.75 and a recall of 0.60. What is its F1-score?
- A. 0.667
- B. 0.675
- C. 0.700
- D. 0.450
Show answer
4. Which metric is most important for a model that screens patients for a serious disease, where “sick” is the positive class and missing a sick patient is dangerous?
- A. Precision
- B. Recall
- C. Accuracy
- D. Specificity
Show answer
5. A team compares four algorithms on two versions of a dataset. What should be kept the same for a fair comparison?
- A. The algorithm
- B. The test data and the metrics
- C. The training time
- D. The hyperparameters of all algorithms
Show answer
6. What happens during backpropagation?
- A. Data flows from the input layer to the output layer
- B. The error is propagated back through the network and weights and biases are adjusted to reduce it
- C. Neurons are removed from the network
- D. The test data is used to tune the network
Show answer
7. What is the role of the activation function in a neuron?
- A. It stores the training data
- B. It adds non-linearity, so the network can learn more than straight-line relationships
- C. It sets the learning rate
- D. It counts the number of epochs
Show answer
8. A perceptron is trained on a problem for 10,000 epochs and never reaches zero errors. What is the most likely cause?
- A. The learning rate is too low
- B. The problem is not linearly separable, so a single perceptron cannot learn it
- C. The perceptron needs more epochs
- D. The perceptron is overfitting
Show answer
9. A test input makes a neuron produce an output higher than any output it produced during training. Which coverage measure does this contribute to?
- A. Neuron coverage only
- B. Neuron boundary coverage
- C. k-multisection neuron coverage
- D. Statement coverage
Show answer
Your score
- 8-9: ready for sections 3.3 and 3.4.
- 6-7: redo the calculations you missed; the K3 questions are worth double.
- 5 or fewer: go back to lesson 18 and practise more confusion matrices.