-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathREADME
More file actions
23 lines (18 loc) · 976 Bytes
/
README
File metadata and controls
23 lines (18 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
==============================================================================
Locality-Sensitive Hashing for the Near(est) Neighbors Problem
==============================================================================
This small library implements LSH-kNN for the masses in Python.
It runs on all your cores. Perfect for your medium-data needs.
==============================================================================
Here's how one might use it:
>>> import lsh
>>> # data is a dictionary of indices.
>>> # number_of_expected_features is an integer expressing how many
>>> # features you, um, expect.
>>> this_lsh = lsh.LSH(d=number_of_expected_features)
>>> this_lsh.bin_data(data)
>>> # Let's find the near neighbors for some query_pt.
>>> query_pt = data[some_index]
>>> near_neighbors = lsh.near_neighbors(some_index, query_pt)
>>> # Bam! You have your near neighbors.
==============================================================================