Class DistanceMeasure (2.16.0)

DistanceMeasure(value)

The distance measure to use when comparing vectors.

Values: DISTANCE_MEASURE_UNSPECIFIED (0): Should not be set. EUCLIDEAN (1): Measures the EUCLIDEAN distance between the vectors. See Euclidean <https://en.wikipedia.org/wiki/Euclidean_distance> to learn more COSINE (2): Compares vectors based on the angle between them, which allows you to measure similarity that isn't based on the vectors magnitude. We recommend using DOT_PRODUCT with unit normalized vectors instead of COSINE distance, which is mathematically equivalent with better performance. See Cosine Similarity <https://en.wikipedia.org/wiki/Cosine_similarity> to learn more. DOT_PRODUCT (3): Similar to cosine but is affected by the magnitude of the vectors. See Dot Product <https://en.wikipedia.org/wiki/Dot_product>__ to learn more.