nmslib
nmslib copied to clipboard
FEATURE REQUEST: Distance metric weighting
Is it possible to use distance metric weighting if using l1, l2, or p norm ?
Hi @cibic89 this requires extending a library and implementing a new "space".
@searchivarius
Hi, I do not find the doc about how to use space
and the param of any space
, where could I find the doc about space/distance method?
an example:
index = nmslib.init(method='hnsw', space='cosinesimil')
index.addDataPointBatch(data)
index.createIndex({'post': 2}, print_progress=True)
where is the info of param {post:2}
?
Thanks.
Hi @ubear info on spaces is the manual (just skip all the installation stuff). It's not fully up to date, but kinda close: https://github.com/searchivarius/nmslib/blob/master/manual/manual.pdf post=0 means shortest indexing time post=1 and post=2 means some postprocessing of the index which leads to better performance, but at the expense of longer indexing.
@searchivarius thanks. I have another question. if I want to use L2 space, but sort the search result by asc, how to do it ?
@ubear asc? do you mean finding the farthest neighbor?
@searchivarius I'm sorry that I have mistaken it. Thank very much!
@ubear no worries, but I still didn't get your question :-)
Well, maybe u can refer to https://arxiv.org/pdf/1405.5869.pdf about Chapter 3.3. @searchivarius
@ubear we support for inner product spaces, but eventually we sort results in the order of their ascending distance, because the actual dissimilarity we use is the negative inner product. So, I still don't understand what you ask me about.