Add knn method.