Share via


DistanceFunction Class

Definition

Defines a list of well-known distance functions that can be used to compare vectors.

public ref class DistanceFunction abstract sealed
public static class DistanceFunction
type DistanceFunction = class
Public Class DistanceFunction
Inheritance
DistanceFunction

Remarks

Not all Vector Store connectors support all distance functions, and some connectors might support additional distance functions that aren't defined here. For more information on what's supported, see the documentation for each connector.

Fields

CosineDistance

Specifies the function that measures the cosine (angular) distance between two vectors.

CosineSimilarity

Specifies the function that measures the cosine (angular) similarity between two vectors.

DotProductSimilarity

Specifies the dot product similarity function, which measures both the length and angle between two vectors.

EuclideanDistance

Specifies the function that measures the Euclidean distance between two vectors.

EuclideanSquaredDistance

Specifies the function that measures the Euclidean squared distance between two vectors.

HammingDistance

Specifies the function that measures the number of differences between vectors at each dimension.

ManhattanDistance

Specifies the function that measures the Manhattan distance between two vectors.

NegativeDotProductSimilarity

Specifies the negative dot product similarity function, which measures both the length and angle between two vectors.

Applies to