Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching K nearest neighbors for each test sample in training set #40

Open
isablle31 opened this issue Oct 4, 2018 · 1 comment
Open

Comments

@isablle31
Copy link

Is there a way to extract the K nearest neighbors from Training samples from the KNN model in the Scala version?

@saurfang
Copy link
Owner

saurfang commented Oct 5, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants