K-NN Flashcards
How do we classify a point using K-NN?
Look at the k nearest points. Assign the most common class.
How do we use K-NN for regression?
Look at the K nearest neighbours, and then take the average of those neighbours.
What is the L2 Norm?
The Euclidean Distance
What can we use instead of Euclidean Distance for K-NN?
Similarity Measures
- Inner Product
- Cosine Similarity
What is the Minkowski distance?
A generalisation of the euclidean distance,
where instead of squaring and square rooting
we use t
so
(|a-b|^t) ^ (1/t)
this extends to higher dimensions
What is the Hyper-parameter in K-NN?
The neighbour number K
For a classification using N classes, what choices of K should we avoid when using K-NN?
We should never set K to equal aN
Setting K to be a multiple of N may result in ties, making it impossible to come to a decision.
What may be the consequence of choosing a small K for K-NN?
We may model noise
What may be the consequence of choosing a large K for K-NN?
We may include too many samples from other classes,
which can negatively affect our prediction.
Gives us an inaccurate prediction.
How many parameters are used in K-NN?
0 parameters used.
This is a non-parametric model.