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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size HashedKNN-1.0.0-py3-none-any.whl (3.6 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Close
Hashes for HashedKNN-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4ef934381d6325819a6e2df1a62443e11df900a4eb0ae7e2f369527e6c3f655 |
|
MD5 | 47a8c0119b41f3168513f4c897acac56 |
|
BLAKE2-256 | dec8d53a03663357476d3428b7adc6234aa622e54a0600eb13ae5e176366b6b4 |