Enum DistanceFunction

    • Enum Constant Detail

      • COSINE_SIMILARITY

        public static final DistanceFunction COSINE_SIMILARITY
        Cosine (angular) similarity function.
      • COSINE_DISTANCE

        public static final DistanceFunction COSINE_DISTANCE
        Cosine distance function. 1 - cosine similarity.
      • DOT_PRODUCT

        public static final DistanceFunction DOT_PRODUCT
        Dot product between two vectors.
      • EUCLIDEAN_DISTANCE

        public static final DistanceFunction EUCLIDEAN_DISTANCE
        Euclidean distance function. Also known as L2 distance.
      • UNDEFINED

        public static final DistanceFunction UNDEFINED
        No distance function specified. It will default to the database's default distance function.
    • Method Detail

      • values

        public static DistanceFunction[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DistanceFunction c : DistanceFunction.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DistanceFunction valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getValue

        public String getValue()
        Gets the function name.
        Returns:
        The function name.