com.soundcloud.lsh

Lsh

class Lsh extends Joiner with Serializable

Lsh implementation as described in 'Randomized Algorithms and NLP: Using Locality Sensitive Hash Function for High Speed Noun Clustering' by Ravichandran et al. See original publication for a detailed description of the parameters.

See also

http://dl.acm.org/citation.cfm?id=1219917

Linear Supertypes
Serializable, Serializable, Joiner, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Lsh
  2. Serializable
  3. Serializable
  4. Joiner
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Lsh(minCosineSimilarity: Double, dimensions: Int, numNeighbours: Int, numPermutations: Int, partitions: Int = 200, storageLevel: StorageLevel = ...)

    minCosineSimilarity

    minimum similarity two items need to have otherwise they are discarded from the result set

    dimensions

    number of random vectors (hyperplanes) to generate bit vectors of length d

    numNeighbours

    beam factor e.g. how many neighbours are considered in the sliding window

    numPermutations

    number of times bitsets are permuted

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def createSlidingWindow(signatures: RDD[Signature], b: Int): RDD[Seq[Signature]]

    Creates a sliding window

  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def findNeighbours(signatures: RDD[Seq[Signature]], minCosineSimilarity: Double): RDD[MatrixEntry]

  13. def generatePermutation(size: Int): Iterable[Int]

    Generates a random permutation of size n

  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. def join(inputMatrix: IndexedRowMatrix): CoordinateMatrix

    Find the k nearest neighbors from a data set for every other object in the same data set.

    Find the k nearest neighbors from a data set for every other object in the same data set. Implementations may be either exact or approximate.

    returns

    a similarity matrix with MatrixEntry(itemA, itemB, similarity).

    Definition Classes
    LshJoiner
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. def neighbours(signatures: Iterable[Signature], minCosineSimilarity: Double): Iterator[MatrixEntry]

    Generate all pairs and emit if cosine of pair > minCosineSimilarity

  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. def orderByBitSet(signatures: RDD[Signature]): RDD[Signature]

    Orderes an RDD of signatures by their bit set representation

  23. def permuteBitSet(bitSet: BitSet, permutation: Iterable[Int], d: Int): BitSet

    Permutes a bit set representation of a vector by a given permutation

  24. def permuteBitSet(signatures: RDD[Signature], permutation: Iterable[Int], d: Int): RDD[Signature]

    Permutes a signatures by a given permutation

  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def toString(): String

    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Joiner

Inherited from AnyRef

Inherited from Any

Ungrouped