mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lance Norskog <>
Subject "Geometric Random Hyperplane LSH" - simple implementation
Date Mon, 16 May 2011 03:54:44 GMT
Some minor testing, based on previous mail threads (thanks Ted-I-mean-everyone).

A Locality-Sensitive-Hash space is defined 50 random vectors (0->1). A
sample vector's position in the LSH space is a bitset. Each entry the
sign of the cosine distance to that LSH vector. Thus every LSH
distance has 50 bits. This space of course has no negative vectors.

Test data: 1000 random vectors as samples. All values 0->1, linear distribution.
This test data gives no negative cosine distances, and so all bits are
0. This is expected (from previous mail threads).

Now, define the random vectors in the space as the dimension-wise
delta between two random vectors. This gives vector values ranging
from 0.5 to -0.5; The same test of 1000 random vectors gives Hamming
distances of 935 to 950 (non-matching) bits. Here is the
OnlineSummarizer output:

Changing the sample vectors from linear to Gaussian, the distances
range from 915 to 960. The mid quartiles are farther from the median.

Given the central limit theorem blah blah blah, this seems appropriate.

Should I spin a patch? Where would this go? I have dense&sparse
implementations, a Vector wrapper and some unit tests.

Next week in Jerusalem,

Lance Norskog

View raw message