org.apache.mahout.math.neighborhood
Class HashedVector
java.lang.Object
org.apache.mahout.math.DelegatingVector
org.apache.mahout.math.WeightedVector
org.apache.mahout.math.neighborhood.HashedVector
- All Implemented Interfaces:
- Cloneable, Vector
public class HashedVector
- extends WeightedVector
Decorates a weighted vector with a locality sensitive hash.
The LSH function implemented is the random hyperplane based hash function.
See "Similarity Estimation Techniques from Rounding Algorithms" by Moses S. Charikar, section 3.
http://www.cs.princeton.edu/courses/archive/spring04/cos598B/bib/CharikarEstim.pdf
Methods inherited from class org.apache.mahout.math.DelegatingVector |
aggregate, aggregate, all, asFormatString, assign, assign, assign, assign, assign, assign, cross, divide, dot, get, getDistanceSquared, getElement, getIteratorAdvanceCost, getLengthSquared, getLookupCost, getNumNondefaultElements, getNumNonZeroElements, getQuick, getVector, incrementQuick, invalidateCachedLength, isAddConstantTime, isDense, isSequentialAccess, logNormalize, logNormalize, maxValue, maxValueIndex, mergeUpdates, minus, minValue, minValueIndex, nonZeroes, norm, normalize, normalize, plus, plus, set, setQuick, size, times, times, viewPart, zSum |
INVALID_INDEX
protected static final int INVALID_INDEX
- See Also:
- Constant Field Values
HashedVector
public HashedVector(Vector vector,
long hash,
int index)
HashedVector
public HashedVector(Vector vector,
Matrix projection,
int index,
long mask)
HashedVector
public HashedVector(WeightedVector weightedVector,
Matrix projection,
long mask)
computeHash64
public static long computeHash64(Vector vector,
Matrix projection)
hash
public static HashedVector hash(WeightedVector v,
Matrix projection)
hash
public static HashedVector hash(WeightedVector v,
Matrix projection,
long mask)
hammingDistance
public int hammingDistance(long otherHash)
getHash
public long getHash()
toString
public String toString()
- Overrides:
toString
in class WeightedVector
equals
public boolean equals(Object o)
- Overrides:
equals
in class DelegatingVector
hashCode
public int hashCode()
- Overrides:
hashCode
in class DelegatingVector
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.