Method SimilarityDotProduct
SimilarityDotProduct<TElement>(IEnumerable<TElement>, IEnumerable<TElement>, bool)
Translated to the "$similarityDotProduct" operator in MQL to measure the similarity between two vectors.
public static double SimilarityDotProduct<TElement>(IEnumerable<TElement> vector1, IEnumerable<TElement> vector2, bool normalizeScore)
Parameters
vector1IEnumerable<TElement>The first vector to compare. Must have the same length as the second vector.
vector2IEnumerable<TElement>The second vector to compare. Must have the same length as the first vector.
normalizeScoreboolWhether to normalize the result for use as a vector search score.
Returns
- double
The dot-product measure between the two vectors.
Type Parameters
TElementThe vector element type
Exceptions
- NotSupportedException
if used for anything other than translating to MQL.
SimilarityDotProduct<TElement>(ReadOnlyMemory<TElement>, ReadOnlyMemory<TElement>, bool)
Translated to the "$similarityDotProduct" operator in MQL to measure the similarity between two vectors.
public static double SimilarityDotProduct<TElement>(ReadOnlyMemory<TElement> vector1, ReadOnlyMemory<TElement> vector2, bool normalizeScore)
Parameters
vector1ReadOnlyMemory<TElement>The first vector to compare. Must have the same length as the second vector.
vector2ReadOnlyMemory<TElement>The second vector to compare. Must have the same length as the first vector.
normalizeScoreboolWhether to normalize the result for use as a vector search score.
Returns
- double
The dot-product measure between the two vectors.
Type Parameters
TElementThe vector element type
Exceptions
- NotSupportedException
if used for anything other than translating to MQL.