I get same score between euclidean distance and cosine similarity for all questions #3217
Unanswered
stepkurniawan
asked this question in
Q&A
Replies: 2 comments
-
This would be a better question for langchain: https://github.com/langchain-ai/langchain/issues |
Beta Was this translation helpful? Give feedback.
0 replies
-
In the README, it does indicate normalization plays a part for cosine similarity. https://github.com/facebookresearch/faiss?tab=readme-ov-file#introduction |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Im using LangChain x FAISS. And everytime I compare the distance score between the default euclidean and cosine, it will always give me the same score, so I dont know maybe I did something wrong (or not). Could you check please?
This is how I change the distance metrics:
and this is how I check the distance score:
and here is the problem, everytime I get a result, for example, I get a document A, with distance 0.39182765 using euclidean, I also got the same score with cosine, even down to the 8th digits behind comma. With MAX_INNER_PRODUCT i get something different, probably because its searching for maximum, and not minimum.
is it because everything got normalized?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions