bjzu / LocalitySensitiveHashing

A Python library that implements locality-sensitive hashing for the near(est) neighbors problem.

Home Page:http://hamiltonulmer.com/lsh.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

==============================================================================
        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.

==============================================================================

About

A Python library that implements locality-sensitive hashing for the near(est) neighbors problem.

http://hamiltonulmer.com/lsh.html