Add fast knn in prediction function