Class Cosine


  • public final class Cosine
    extends java.lang.Object
    We compute cosine similarity (normalised dot product) and turn it into a similarity metric by moving and clamping -1..1 into 0..1 using linear transformation.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double doubleMetric​(double[] left, double[] right)  
      static double floatMetric​(float[] left, float[] right)  
      • Methods inherited from class java.lang.Object

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

      • floatMetric

        public static double floatMetric​(float[] left,
                                         float[] right)
      • doubleMetric

        public static double doubleMetric​(double[] left,
                                          double[] right)