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

Add method or parameter for returning (itemid, score) tuples #62

Closed
a1k0n opened this issue May 7, 2015 · 6 comments
Closed

Add method or parameter for returning (itemid, score) tuples #62

a1k0n opened this issue May 7, 2015 · 6 comments

Comments

@a1k0n
Copy link
Contributor

a1k0n commented May 7, 2015

It would be nice to be able to iterate over a get_nns call with not just the itemid but the score also, especially as it's available to the C++ code; currently you have to reconstruct the score manually by normalizing and taking your own dot product in numpy or something.

@erikbern
Copy link
Collaborator

erikbern commented May 7, 2015

yes this would be great to add as a new method. can you do it :)

@a1k0n
Copy link
Contributor Author

a1k0n commented May 7, 2015

I'm just relaying a request from your annoy-users@ mailing list. Are you on it?

@erikbern
Copy link
Collaborator

erikbern commented May 7, 2015

Just realized I haven't been seeing annoy-user emails.

I was registered using my spotify email and then when I signed up again I accidentally hit the "don't send me updates" option. Fixed now so I'll keep an eye on the email list going forward!

@erikbern
Copy link
Collaborator

erikbern commented Aug 9, 2015

See #93 – should resolve this issue

@erikbern
Copy link
Collaborator

erikbern commented Aug 9, 2015

Although instead of returning a list of tuples, I return a tuple with two lists. Made the code marginally simpler

@a1k0n
Copy link
Contributor Author

a1k0n commented Aug 10, 2015

Yeah, that makes sense. More compact in memory too. Cool, thanks Erik.

@a1k0n a1k0n closed this as completed Aug 10, 2015
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