Skip to main content

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']]

Release files for lsh-for-indexing 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lsh-for-indexing 0.0.5
File Size Uploaded
lsh-for-indexing-0.0.5.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lsh-for-indexing 0.0.5
File Interpreter ABI Platform
lsh_for_indexing-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / lsh-for-indexing-0.0.5.tar.gz

Download URL lsh-for-indexing-0.0.5.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
eb7f2913297e7a2781ac503f3eab809a1715b0221050355062166beb397db671
BLAKE2b-256 checksum
How to use checksums
a2675064020a8e159dd3e7bf009a5e76912fc5c34681919b969fe944e098ff14
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / lsh_for_indexing-0.0.5-py3-none-any.whl

Download URL lsh_for_indexing-0.0.5-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5e1662e994614cd36b48ec026f800da9e58928c92aba08499b7667c2670ebb3
BLAKE2b-256 checksum
How to use checksums
7bdd2850aca74006a6576970160092b72e64ab061434816eed753fbed266618c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page