Add method in KNN to obtain nearest neighbors.
Internally, the apply now calls the new method to obtain the nearest
neighbors first and then computes the labels.