hnswlib icon indicating copy to clipboard operation
hnswlib copied to clipboard

question about cos-similarity

Open 652994331 opened this issue 2 years ago • 1 comments

hi, I've been using hnsw for a while, it's a nice project, good work! however, recently I have a question about it. I've been using cos, l1, l2 for distance calculation, that reminds me of sklearn cosine similarity. in sklearn, you can control the distance(I forgot the parameter's name), that means you can filter your result when you are using cos-similarity to find items with shorter distance in between. However, in hnsw, it seems we can only set 'cos' to use cosine similarity and get the default results. Just wanna know am I right here? is there any way we can control the cos distance in hnsw? thank you for helping.

652994331 avatar Aug 09 '22 02:08 652994331

Hi @652994331, sorry for a late reply, I've missed this issue for some reason. I am not sure I understood it. The cosine similarity that I know does not have parameters. Can you provide a link to sklearn?

yurymalkov avatar Aug 28 '22 02:08 yurymalkov