r knn distance. There are four steps to perform a complete KNN algorithm