# Question 1

WEEK 7 QUIZ

# Question 1

Which of the following statements is true with reference to the sensitivity of k-nearest neighbours to noise? Select one:

- a. k-NN is sensitive to noise irrespective the number of neighbours.
- b. As the number of neighbours increases, k-NN becomes less sensitive to noise.
- c. k-NN becomes less sensitive for smaller values of k.
- d. k-NN is insensitive to noise

- Memo
The correct answer is: b) As the number of neighours increases, k-NN becomes less sensitive to noise

# Question 2

TRUE OR FALSE: The k-nearest neighbour algorithm can be applied only to problems with numerical input features

- Memo
The correct answer is: False

# Question 3

TRUE OR FALSE: The k-nearest neighbour algorithm can be applied to classification problems which has more than two classes.

- Memo
The correct answer is: True

# Question 4

TRUE OR FALSE: k-Nearest neighbour is insensitive to target feature based outliers when the algorithm is applied to regression problem

- Memo
The correct answer is: False

# Question 5

The k-Nearest neighbour algorithm becomes less sensitive to noise for larger values for k.

- Memo
The correct answer is: True

# Question 6

TRUE OR FALSE: For k-NN that uses Euclidean distance, it is not necessary to normalize descriptive feature values

- Memo
The correct answer is: False

# Question 7

TRUE OR FALSE: The k-NN algorithm actually does not perform any form of learning

- Memo
The correct answer is: True

# Question 8

TRUE OR FALSE: The inductive bias of k-NN applied to a classification problem is that instances of data close to each other in feature space belong to the same class

- Memo
The correct answer is: True

Similar data points should have a similar target.

# Question 9

TRUE OR FALSE: If for some problem there are many features with missing values, then it is suitable to ignore all of those features within the distance calculation.

- Memo
The correct answer is: False

If there are not too many features that have missing values, then one can ignore the features with missing values within the distance calculation. k-NN is somewhat robust to missing values so long as not too many missing values across various features. In this question there are "many features with missing values".

==Applicable to the next set of questions:== The dataset below contains two instances and two features (f1 and f2). The target is provided.

ID | $\mathbf{f 1}$ | $\mathbf{f 2}$ | target |
---|---|---|---|

1 | 500 | 4 | 320 |

2 | 550 | 7 | 380 |

Assume a multivariate linear regression model is used to solve this problem, given the following weights: $w0(t=0)= -0.146$ $w1(t=0) = 0.185$ $w2(t=0) = -0.044$

# Question 10

Calculate the model output for instance 1.

- Memo
The correct answer is: 92.178

-0.146+0.185*\500-0.044*4

# Question 11

Calculate the model output for instance 2.

- Memo
The correct answer is: 101.296

-0.146+0.185*550-0.044*7

# Question 12

Calculate the error that the model makes on instance 1.

- Memo
The correct answer is: 227.822

$320-92.178$

# Question 13

Calculate the error that the model makes on instance 2.

- Memo
The correct answer is: 278.704

$380-101.296$

# Question 14

Calculate the delta value for w0 on instance 1.

- Memo
The correct answer is: 227.822

Since d0=1, then delta w0 for instance 1 is simply the same value of the error for instance one. (tiMw(d))*dj,i in this case j = 0 (feature 0) and thus d0 = 1.

# Question 15

Calculate the delta value for w0 on instance 2

- Memo
The correct answer is: 278.704

Since d0=1, then delta w0 for instance 1 is simply the same value of the error for instance two. (tiMw(d))*dj,i in this case j = 0 (feature 0) and thus d0 = 1.

# Question 16

Calculate delta w1 for instance 1.

- Memo
The correct answer is: 113911

Multiply the error value with the value of the feature

227.822*500

# Question 17

Calculate delta w1 for instance 2.

- Memo
The correct answer is: 153287.2

Multiply the value of the error with the value of the feature (550)

278.704*550

# Question 18

Calculate the error signal for w0. (i.e. the value that will be used to perform the weight update). In the lecture notes this is denoted as delta (D,w0)

- Memo
The correct answer is: 506.526

Here you sum of the individual error values 227.822+278.704

# Question 19

Calculate the error signal for w1. (i.e. the value that will be used to perform the weight update). In the lecture notes this is denoted as delta (D,w1)

- Memo
The correct answer is: 267198.2

Here you find the sum of the individual error values 113911+153287.2