Package | Description |
---|---|
be.tarsos.lsh |
Contains the main entry points and data structures to enable an LSH scheme.
|
be.tarsos.lsh.families |
Contains implementations and abstractions for several locality sensitive hash functions and families.
|
be.tarsos.lsh.util |
Contains utility classes, e.g.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<Vector> |
LSH.linearSearch(java.util.List<Vector> dataset,
Vector query,
int resultSize,
DistanceMeasure measure)
Search for the actual nearest neighbours for a query vector using an
exhaustive linear search.
|
java.util.List<Vector> |
LSH.query(Vector query,
int neighboursSize)
Find the nearest neighbours for a query in the index.
|
java.util.List<Vector> |
Index.query(Vector query,
int maxSize)
Query for the k nearest neighbours in using the current index.
|
static java.util.List<Vector> |
LSH.readDataset(java.lang.String file,
int maxSize)
Read a data set from a text file.
|
Modifier and Type | Method and Description |
---|---|
double |
Vector.dot(Vector other)
Calculates the dot product, or scalar product, of this vector with the
other vector.
|
void |
Index.index(Vector vector)
Add a vector to the current index.
|
static java.util.List<Vector> |
LSH.linearSearch(java.util.List<Vector> dataset,
Vector query,
int resultSize,
DistanceMeasure measure)
Search for the actual nearest neighbours for a query vector using an
exhaustive linear search.
|
java.util.List<Vector> |
LSH.query(Vector query,
int neighboursSize)
Find the nearest neighbours for a query in the index.
|
java.util.List<Vector> |
Index.query(Vector query,
int maxSize)
Query for the k nearest neighbours in using the current index.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<Vector> |
LSH.linearSearch(java.util.List<Vector> dataset,
Vector query,
int resultSize,
DistanceMeasure measure)
Search for the actual nearest neighbours for a query vector using an
exhaustive linear search.
|
Constructor and Description |
---|
Vector(Vector other)
Copy constructor.
|
Constructor and Description |
---|
LSH(java.util.List<Vector> dataset,
HashFamily hashFamily) |
Modifier and Type | Method and Description |
---|---|
int |
DistanceComparator.compare(Vector one,
Vector other) |
double |
EuclideanDistance.distance(Vector one,
Vector other) |
double |
CosineDistance.distance(Vector one,
Vector other) |
double |
DistanceMeasure.distance(Vector one,
Vector other)
Calculate the distance between two vectors.
|
double |
IntersectionDistance.distance(Vector one,
Vector other) |
double |
CityBlockDistance.distance(Vector one,
Vector other) |
int |
HashFunction.hash(Vector vector)
Hashes a vector of arbitrary dimensions to an integer.
|
int |
CosineHash.hash(Vector vector) |
int |
CityBlockHash.hash(Vector vector) |
int |
EuclideanHash.hash(Vector vector) |
Constructor and Description |
---|
DistanceComparator(Vector query,
DistanceMeasure distanceMeasure) |
Modifier and Type | Method and Description |
---|---|
static java.util.List<Vector> |
TestUtils.generate(int dimensions,
int datasetSize,
int maxValue)
Generate a data set.
|
Modifier and Type | Method and Description |
---|---|
static void |
TestUtils.addNeighbours(java.util.List<Vector> dataset,
int numberOfNeighboursToAdd,
double radius)
Adds neighbours to each element in a data set.
|