Implement KNN classifier