spark-knn
spark-knn copied to clipboard
Searching K nearest neighbors for each test sample in training set
trafficstars
Is there a way to extract the K nearest neighbors from Training samples from the KNN model in the Scala version?
Yes. You simply run transform again on the training data to get the K neighbors for every point in the dataset. https://github.com/saurfang/spark-knn/blob/master/spark-knn-core/src/test/scala/org/apache/spark/ml/knn/KNNSuite.scala#L31