E - the type of data objects in the hash table.public class MPLSH<E> extends Object implements NearestNeighborSearch<double[],E>, KNNSearch<double[],E>, RNNSearch<double[],E>
LSH| Constructor and Description |
|---|
MPLSH(int d,
int L,
int k,
double r)
Constructor.
|
MPLSH(int d,
int L,
int k,
double r,
int H)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isIdenticalExcluded()
Get whether if query object self be excluded from the neighborhood.
|
Neighbor<double[],E>[] |
knn(double[] q,
int k)
Search the k nearest neighbors to the query.
|
Neighbor<double[],E>[] |
knn(double[] q,
int k,
double recall,
int T)
Returns the approximate k-nearest neighbors.
|
void |
learn(RNNSearch<double[],double[]> range,
double[][] samples,
double radius)
Train the posteriori multiple probe algorithm.
|
void |
learn(RNNSearch<double[],double[]> range,
double[][] samples,
double radius,
int Nz)
Train the posteriori multiple probe algorithm.
|
void |
learn(RNNSearch<double[],double[]> range,
double[][] samples,
double radius,
int Nz,
double sigma)
Train the posteriori multiple probe algorithm.
|
Neighbor<double[],E> |
nearest(double[] q)
Search the nearest neighbor to the given sample.
|
Neighbor<double[],E> |
nearest(double[] q,
double recall,
int T)
Returns the approximate nearest neighbor.
|
void |
put(double[] key,
E value)
Insert an item into the hash table.
|
void |
range(double[] q,
double radius,
List<Neighbor<double[],E>> neighbors)
Search the neighbors in the given radius of query object, i.e.
|
void |
range(double[] q,
double radius,
List<Neighbor<double[],E>> neighbors,
double recall,
int T)
Search the neighbors in the given radius of query object, i.e.
|
void |
setIdenticalExcluded(boolean excluded)
Set if exclude query object self from the neighborhood.
|
String |
toString() |
public MPLSH(int d,
int L,
int k,
double r)
d - the dimensionality of data.L - the number of hash tables.k - the number of random projection hash functions, which is usually
set to log(N) where N is the dataset size.r - the width of random projections. It should be sufficiently
away from 0. But we should not choose an r value that is too large, which
will increase the query time.public MPLSH(int d,
int L,
int k,
double r,
int H)
d - the dimensionality of data.L - the number of hash tables.k - the number of random projection hash functions, which is usually
set to log(N) where N is the dataset size.r - the width of random projections. It should be sufficiently
away from 0. But we should not choose an r value that is too large, which
will increase the query time.H - the number of buckets of hash tables.public boolean isIdenticalExcluded()
public void setIdenticalExcluded(boolean excluded)
public void put(double[] key,
E value)
public void learn(RNNSearch<double[],double[]> range, double[][] samples, double radius)
range - the neighborhood search data structure.radius - the radius for range search.samples - the training samples.public void learn(RNNSearch<double[],double[]> range, double[][] samples, double radius, int Nz)
range - the neighborhood search data structure.radius - the radius for range search.Nz - the number of quantized values.public void learn(RNNSearch<double[],double[]> range, double[][] samples, double radius, int Nz, double sigma)
range - the neighborhood search data structure.radius - the radius for range search.Nz - the number of quantized values.sigma - the Parzen window width.public Neighbor<double[],E> nearest(double[] q)
NearestNeighborSearchnearest in interface NearestNeighborSearch<double[],E>q - the query key.public Neighbor<double[],E> nearest(double[] q, double recall, int T)
q - the query object.recall - the expected recall rate.T - the maximum number of probes.public Neighbor<double[],E>[] knn(double[] q, int k)
KNNSearchpublic Neighbor<double[],E>[] knn(double[] q, int k, double recall, int T)
q - the query object.k - the number of nearest neighbors to search for.recall - the expected recall rate.T - the maximum number of probes.public void range(double[] q,
double radius,
List<Neighbor<double[],E>> neighbors)
RNNSearchpublic void range(double[] q,
double radius,
List<Neighbor<double[],E>> neighbors,
double recall,
int T)
q - the query object.radius - the radius of search range.neighbors - the list to store found neighbors in the given range on output.recall - the expected recall rate.T - the maximum number of probes.Copyright © 2015. All rights reserved.