To use the kNN classifier in Weka (Waikato Environment for Knowledge Analysis) you have to click on the label under
‘Classifier’, and then choose ‘IBk’ from the drop-down menu.

The option ‘KNN’ defines the number of neighbors.
The
‘distanceWeighting’ option allows to adapt the influence of the
neighbours according to their distance, and ‘crossValidate’ searches for the best “k” value using crossvalidation.