VarIr / scikit-hubness

A Python package for hubness analysis and high-dimensional data mining
BSD 3-Clause "New" or "Revised" License
44 stars 9 forks source link

class skhubness.neighbors.HNSW does not support distance type FLOAT #70

Closed ivan-marroquin closed 3 years ago

ivan-marroquin commented 3 years ago

Hi,

I would like to report the following issue when using HNSW:

import numpy as np from skhubness.neighbors import HNSW

X= np.random.randn(100,7)

index= HNSW(n_candidates= 10, metric= 'euclidean', method= 'hsnw')

index.fit(X)

The last command produces the following error message: Traceback (most recent call last): File "", line 1, in File "C:\Temp\Python\Python3.6.5\lib\site-packages\scikit_hubness-0.21.3-py3.6.egg\skhubness\neighbors\hnsw.py", line 106, in fit print_progress=(self.verbose >= 2)) RuntimeError: 2021-06-08 15:43:40 .\similarity_search\include\methodfactory.h:60 (similarity::MethodFactoryRegistry::CreateMethod) It looks like the method hsnw is not defined for the distance type : FLOAT

Ivan

VarIr commented 3 years ago

It should work with method='hnsw'.