# The K-Nearest Neighbours (KNN) classifier

## K-Nearest Neighbours (KNN)

### K-nearest neighbours

K-nearest neighbours is a non-parametric classifer. For a point with an unknown class we identify the classes of the \(K\)-nearest neighbours and assign the most common class.

For this we need to find the distance between observations. We can do this using norms.

Weightings of the dependent variables is important here.

#### Practicality

Requires space to store

N samples, d features

times: O(n.d)

### Choosing K for K-Nearest Neighbours