yahoojapan / NGT

Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data
Apache License 2.0
1.26k stars 115 forks source link

Non-similar length vectors? #128

Closed Hadryan closed 1 year ago

Hadryan commented 1 year ago

How to search on Arbitrary length vectors? e.g.:

{1, 0, ..., 1.32} [500 dimensions] {4, 1, ..., 6.12} [503 dimensions] ... {0.5, 0.74, ..., 0.2} [501 dimensions]

masajiro commented 1 year ago

What is the similarity metric for the vectors?

Hadryan commented 1 year ago

Cosine similarity of QG. However if any other methods support non-similar length vectors, I'd be more than happy to test

masajiro commented 1 year ago

My understanding is that the cosine similarity is defined on fixed dimension vectors. How do you compute the cosine similarity for variable length vectors?