Nearest Neighbour Flashcards
What is Voronoi tesselation?
Partitions space into regions where all points are closer to the regions training point than any other point
What is a Voronoi cell?
A single region in a Voronoi tessalation
What is the decision boundary for 1 nearest neighbor?
The edges of all pairs of Voronoi cell that contain training examples from diffrent classes
kNN classification algorithm
- Compute distance D(x, xi) to every training example
- Select k closest instances
- Output the most frequent class
kNN regression algorithm
- Compute distance D(x, xi) to every training example
- Select k closest instances
- Output the mean of closest instances
What is interpolation?
Prediction within range of the training examples
What is extrapolation?
Prediction outside the range of training examples
What happens when you pick small values for k in kNN?
Small changes in training set produce large changes in classification
What happens when you pick very large values for k in kNN?
Everything is classified as the most probable class P(y)
How can we choose the right value for k in kNN?
Train kNN for k = 1, 2, 3, … then pick the model with the smallest validation error on the validation set
Whats the definition of D(x, x’) if D is the euclidian distance function and x has d dimensions?
Whats the definition of D(x, x’) if D is the hamming distance function and x has d dimensions?
Whats the definition of D(x, x’) if D is the minkowski (p-norm) distance function and x has d dimensions?
What is distance function obtained when p=2 for p-norm?
Euclidian
What is distance function obtained when p=1 for p-norm?
Manhatten