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

fix: modify KNN to also explore boundaries that do not contain the query point #1

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

JWSong
Copy link
Collaborator

@JWSong JWSong commented May 18, 2024

This will resolve the issue where the K-Nearest Neighbors algorithm cannot find points that are outside of the boundary to which it belongs.

@JWSong JWSong requested review from Eveheeero and Migorithm May 18, 2024 13:35
@JWSong JWSong self-assigned this May 18, 2024
pub latitude: NonNanFloat,
}

pub trait TCoordianteFloat {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conversion logic is already implemented for f64. Perhaps, Trait is not necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted to limit the types it can take.

self.search(&mut nearest_neighbors, query_point, k);

nearest_neighbors
.into_sorted_vec()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would the cost of into_sorted_vec like?

rust-lang/rust#115357

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering the use case, it seems unlikely that we will need to use a large value for 'k'.

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

Successfully merging this pull request may close these issues.

2 participants