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

cosine distance instead of cosine similarity #456

Closed
anna-charlotte opened this issue Apr 24, 2023 · 2 comments
Closed

cosine distance instead of cosine similarity #456

anna-charlotte opened this issue Apr 24, 2023 · 2 comments

Comments

@anna-charlotte
Copy link

Hello there,

I think there has been a mix up with cosine similarity and cosine distance. In the docs it says that you support cosine similarity. But instead the cosine distance is calculated (1- cosine sim.).
The resulting order is still correct, but when looking at the scores, they are incorrect. For instance, when computing the distance of vector x = [1.0, 1.0, 1.0, 0.0] to itself, the resulting score is 0.0. For the cosine similarity it would be 1. though instead of 0.

Could you adjust the formula?

@yurymalkov
Copy link
Member

Hi @anna-charlotte,
Thanks for highlighting the issue! It seems like we can also rename cosine similarity to cosine distance to avoid this confusion.
Changing the formula will break previous code.

@anna-charlotte
Copy link
Author

Hi @yurymalkov sure sounds good, too 👍

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