Class VectorDocumentDistanceMeasurer<T>

  • Type Parameters:
    T - the possible key type. On sparse vectors where inverted indices are used, this is the dimension where the value not equals 0.
    All Implemented Interfaces:
    InvertedIndex.DocumentDistanceMeasurer<de.jungblut.math.DoubleVector,​T>

    public final class VectorDocumentDistanceMeasurer<T>
    extends java.lang.Object
    implements InvertedIndex.DocumentDistanceMeasurer<de.jungblut.math.DoubleVector,​T>
    Document distance measurer on vectors (basically a proxy to the real DistanceMeasurer).
    Author:
    thomas.jungblut
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double measure​(de.jungblut.math.DoubleVector reference, java.util.Set<T> referenceKeys, de.jungblut.math.DoubleVector doc, java.util.Set<T> docKeys)
      Measures the distance (value between 0.0 and 1.0) between a reference document and a candidate document.
      static <T> VectorDocumentDistanceMeasurer<T> with​(DistanceMeasurer measurer)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • measure

        public double measure​(de.jungblut.math.DoubleVector reference,
                              java.util.Set<T> referenceKeys,
                              de.jungblut.math.DoubleVector doc,
                              java.util.Set<T> docKeys)
        Description copied from interface: InvertedIndex.DocumentDistanceMeasurer
        Measures the distance (value between 0.0 and 1.0) between a reference document and a candidate document.
        Specified by:
        measure in interface InvertedIndex.DocumentDistanceMeasurer<de.jungblut.math.DoubleVector,​T>
        Parameters:
        reference - the reference document.
        referenceKeys - the reference document key parts.
        doc - the candidate document.
        docKeys - the candidate document key parts.
        Returns:
        a value between 0d and 1d where 0d is most similar.