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

Bug: python radius has no effect #549

Open
3 tasks done
jmif opened this issue Jan 10, 2025 · 2 comments
Open
3 tasks done

Bug: python radius has no effect #549

jmif opened this issue Jan 10, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@jmif
Copy link

jmif commented Jan 10, 2025

Describe the bug

Whens searching with

res = self.index.search(
    query_value,
    radius=1.5,
)

The results returned do not respect radius, looking at the code it seems that radius isn't passed along. When I try to pass it along I get an error and inspecting the C++ API I don't see radius as a supported param.

Steps to reproduce

  1. Build a basic python index
  2. Search with a radius parameter
  3. Notice that results are returned with higher radius

Expected behavior

Only results within the radius are returned.

USearch version

latest

Operating System

macOS

Hardware architecture

Arm

Which interface are you using?

Python bindings

Contact Details

No response

Are you open to being tagged as a contributor?

  • I am open to being mentioned in the project .git history as a contributor

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jmif jmif added the bug Something isn't working label Jan 10, 2025
@ashvardanian
Copy link
Contributor

That's true, @jmif! The radius support was meant to be added in v2, but didn't receive enough interest and has been abandoned. Let me see if we can integrate it in the next major release 🤔

@jmif
Copy link
Author

jmif commented Jan 28, 2025

Good to know! We're definitely interested as we're using it to power a large DBSCSN clustering where we need all neighbors < the eps value. Right now we return N nearest neighbors where N is the largest possible value we think is possible and then we manually filter the epsilons, but the performance of the search improves as we lower N so it'd be great to do this at the library level where I'm assuming the search could stop early? Also - curious if there's a recommended way or more efficient way to do what I've described that I've missed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants