public abstract class LSH
extends java.lang.Object
Locality-sensitive hashing (LSH) is a method of performing probabilistic dimension reduction of high-dimensional data. The basic idea is to hash the input items so that similar items are mapped to the same buckets with high probability (the number of buckets being much smaller than the universe of possible input items).
Modifier and Type | Field and Description |
---|---|
protected int |
dim |
protected org.apache.commons.math.random.RandomGenerator |
rg |
Constructor and Description |
---|
LSH(int dim,
org.apache.commons.math.random.RandomGenerator rg)
Construct a locality sensitive hash.
|
Modifier and Type | Method and Description |
---|---|
abstract long |
apply(org.apache.commons.math.linear.RealVector vector)
Hash a vector.
|
int |
getDim() |
org.apache.commons.math.random.RandomGenerator |
getRandomGenerator() |
public LSH(int dim, org.apache.commons.math.random.RandomGenerator rg)
dim
- The dimension of the vectors which are to be hashedrg
- The random generator to use internally.public org.apache.commons.math.random.RandomGenerator getRandomGenerator()
public int getDim()
public abstract long apply(org.apache.commons.math.linear.RealVector vector)
vector
- A vector to be hashed