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

[DOC] Add note for cosine similarity vector space that vectors cant be 0 vec #6678

Closed
1 of 4 tasks
jmazanec15 opened this issue Mar 14, 2024 · 2 comments · Fixed by #6698
Closed
1 of 4 tasks

[DOC] Add note for cosine similarity vector space that vectors cant be 0 vec #6678

jmazanec15 opened this issue Mar 14, 2024 · 2 comments · Fixed by #6698
Assignees
Labels
3 - Done Issue is done/complete v2.13.0
Milestone

Comments

@jmazanec15
Copy link
Member

What do you want to do?

  • Request a change to existing documentation
  • Add new documentation
  • Report a technical problem with the documentation
  • Other

Tell us about your request. Provide a summary of the request and all versions that are affected.
The cosine similarity metric for k-NN is computed as (a . b)/(|a|*|b|) where "." means dotproduct and || means the magnitude of the vector. If a or b is all zero's, this would lead to a divide by 0 exception. So, in opensearch-project/k-NN#1501, we are rejecting requests for indices that use cosine similarity if the vector is 0.

For this, we need to update the documentation to tell users that we will reject these requests. I think the best place to do this would be here:

  1. https://opensearch.org/docs/latest/search-plugins/knn/approximate-knn/#spaces
  2. https://opensearch.org/docs/latest/search-plugins/knn/approximate-knn/#spaces
  3. https://opensearch.org/docs/latest/search-plugins/knn/knn-score-script/#spaces

What other resources are available? Provide links to related issues, POCs, steps for testing, etc.
Related to this PR: opensearch-project/k-NN#1501.

@hdhalter hdhalter added 1 - Backlog - DEV Developer assigned to issue is responsible for creating PR. and removed untriaged labels Mar 14, 2024
@hdhalter
Copy link
Contributor

Thanks, @jmazanec15! Will this be part of the 2.13, or should we backport it to 2.12?

@jmazanec15
Copy link
Member Author

@hdhalter this will be part of 2.13

@hdhalter hdhalter added this to the v2.13 milestone Mar 15, 2024
@hdhalter hdhalter added 2 - In progress Issue/PR: The issue or PR is in progress. and removed 1 - Backlog - DEV Developer assigned to issue is responsible for creating PR. labels Mar 18, 2024
@hdhalter hdhalter added 3 - Done Issue is done/complete and removed 2 - In progress Issue/PR: The issue or PR is in progress. labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Done Issue is done/complete v2.13.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants