jina.executors.indexers.query.vector

class jina.executors.indexers.query.vector.NumpyQueryIndexer(metric='cosine', backend='numpy', compress_level=0, *args, **kwargs)[source]

Bases: jina.executors.indexers.vector.NumpyIndexer, jina.executors.indexers.query.BaseQueryIndexer

An exhaustive vector indexers implemented with numpy and scipy.

Note

Metrics other than cosine and euclidean requires scipy installed.

Parameters
  • metric (str) – The distance metric to use. braycurtis, canberra, chebyshev, cityblock, correlation, cosine, dice, euclidean, hamming, jaccard, jensenshannon, kulsinski, mahalanobis, matching, minkowski, rogerstanimoto, russellrao, seuclidean, sokalmichener, sokalsneath, sqeuclidean, wminkowski, yule.

  • backend (str) – numpy or scipy, numpy only supports euclidean and cosine distance

  • compress_level (int) – compression level to use