Thanks to those who answered my previous questions and got me so far.
I have a table of approximately 25,000 vectors, each with 48 sizes, with values ββfrom 0 to 255.
I am trying to develop a Locality Sensitive Hash algorithm ( http://en.wikipedia.org/wiki/Locality-sensitive_hashing ) to search for the nearest neighboring or nearest neighboring points.
My current LSH function is this:
def lsh(vector, r = 1.0, a = None, b = None):
if not a:
a = [normalvariate(10, 4) for i in range(48)]
if not b:
b = uniform(0, r)
hashVal = floor((sum([a[i]*vector[i] for i in range(48)]) + b)/r)
return int(hashVal)
My questions at this point:
A:. "normalvariate (10, 4)" . , random.normalvariate(http://docs.python.org/library/random.html#random.normalvariate), "d- , ". , , .
B: wikipedia :
d (p, q) <= R, h (p) = h (q) P1
d (p, q) >= cR, h (p) = h (q) P2
R, R, " ". (http://en.wikipedia.org/wiki/Locality-sensitive_hashing#Stable_distributions)
C: (B). , R hasing . R.
D: , ?