2

Product Quantization (and following works) are very efficient and precise solutions for solving the Approximate Nearest Neighbors problem. My question is: can they be used only for encoding vectors in Euclidean distances or any other distance?

user6321
  • 389
  • 3
  • 12

1 Answers1

1

Product Quantization is based on k-means, and k-means only works with Euclidean distance, see this question Why does k-means clustering algorithm use only Euclidean distance metric?


And there're some other awesome choices recently for ANN, such as ANNOY and Navigable Small Worlds, which can work with other metrics or non-metrics.

dontloo
  • 13,692
  • 7
  • 51
  • 80
  • I've heard about these recently libraries, I will check them better. However, I've heard many times that if we have an euclidean approach for (A)NN we can use it for cosine similarity too. Is it correct? If so, how? – user6321 Oct 26 '16 at 16:41
  • @user6321 well I don't know much about that, if fact I only started working with ANN recently, but based on my experience on other problems these two can be quite different. – dontloo Oct 26 '16 at 16:54