Chapter 2: K Nearest Neighbours Flashcards

1
Q

give the KNN classification rule

A
get distances (xte, xtr)
sort 
select k nearest
assign yte as most common class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are two distance measures

A

Euclidean distance

minkowski distance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

explain Euclidean distance

A

|| p - q || 2

the square root or the difference between each vector squared

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

explain minkowski distance

A

[ sum to d | pi - qi | ^ t ] ^ 1/t

if t = 2, same as Euclidean distance
if t = 1, city block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

give two similarity measures

A

inner product

cosine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

describe inner product

A

sum to d piqi

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

describe cosine as a similarity measure

A

sum piqi / ||p||2||q||2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is the effect of increasing the number of training samples

A

more accurate

but too many or too much noise will cause overfitting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is the effect of increasing k

A

a small k may model noise

a large k will include too many points from other classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

in binary classification, k must be…

A

odd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

give the KNN regression rule

A

measure the distance (xte, xtr)
sort distances
select k nearest
calculate the average of these

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what does it mean that KNN is non parametric

A

there are no parameters to be optimised

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is the neighbour search algorithm

A

is B is far from A and C is close to B, then C is far from A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is instance based learning

A

output is based on similarity or distance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly