Locality-sensitive hashing to implement K nearesr neighbors fast.
Project description
HasedKNN
LSH based KNN inspired from LSH Attention (Reformer: The Efficient Transformer)
Last Stable Release
$ pip install hashedknn
Usage example
From a jupyter notebook run
import HashedKNN
# Fetch dataset
from sklearn.datasets import fetch_openml
X, y = fetch_openml('mnist_784', version=1, return_X_y=True)
# Run LSH based KNN
knn = HasedKNN(bucket_size=8, number_of_universes=20)
# Fit
knn.fit(X)
# Find ID's of 10 nearest neighbors
id = knn.find(vectorIdx=10, corpus=X, k=10)
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file HashedKNN-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: HashedKNN-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4ef934381d6325819a6e2df1a62443e11df900a4eb0ae7e2f369527e6c3f655 |
|
MD5 | 47a8c0119b41f3168513f4c897acac56 |
|
BLAKE2b-256 | dec8d53a03663357476d3428b7adc6234aa622e54a0600eb13ae5e176366b6b4 |