Package for indexing vectors to solr/es
Project description
LSH for indexing
This package helps search engines to index and easily search on vector using Local sensitivity hashing (LSH)
Installation
pip install -i https://test.pypi.org/simple/ lsh-for-indexing
Usage example
from lsh.random_projection import LshGaussianRandomProjection
import numpy as np
rp = LshGaussianRandomProjection(vector_dimension=6, bucket_size=3, num_of_buckets=2) import numpy as np
vec = np.asarray([1,0,1,1,0,0])
rp.fit()
rp.indexable_transform(vec)
>> ['0_010', '1_000']
if you know your collection size and you want an optimal number of bucket_size
rp.fit(sample_size=2000)
transforming a bulk of vectors
mat = np.asarray([[1,0,1,1,0,0], [1,0,0,1,0,1]])
rp.indexable_transform(mat)
>> [['0_010', '1_111'], ['0_010', '1_101']]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lsh-for-indexing-0.0.5.tar.gz
.
File metadata
- Download URL: lsh-for-indexing-0.0.5.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb7f2913297e7a2781ac503f3eab809a1715b0221050355062166beb397db671 |
|
MD5 | fc1cb9182199db42d2392d79edb66498 |
|
BLAKE2b-256 | a2675064020a8e159dd3e7bf009a5e76912fc5c34681919b969fe944e098ff14 |
File details
Details for the file lsh_for_indexing-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: lsh_for_indexing-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5e1662e994614cd36b48ec026f800da9e58928c92aba08499b7667c2670ebb3 |
|
MD5 | 22cb2b09c53b21b11167addb435e1c0c |
|
BLAKE2b-256 | 7bdd2850aca74006a6576970160092b72e64ab061434816eed753fbed266618c |