Package com.spotify.voyager.jni
Enum Index.SpaceType
- All Implemented Interfaces:
Serializable
,Comparable<Index.SpaceType>
- Enclosing class:
- Index
The space, also known as distance metric, to use when searching.
SpaceType is a property of an Index, and cannot be changed after instantiation. Loading an index with a different SpaceType than it was created with may result in nonsensical results being returned.
-
Enum Constant Summary
Enum ConstantDescriptionCosine distance; i.e.Euclidean distance, also known asL2
distance.Inner (dot) product. -
Method Summary
Modifier and TypeMethodDescriptionstatic Index.SpaceType
Returns the enum constant of this type with the specified name.static Index.SpaceType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
Euclidean
Euclidean distance, also known asL2
distance. Computed by taking the square root of the sum of squared differences between each element of each vector. -
InnerProduct
Inner (dot) product. Computed by taking the sum of the products of each element of each vector. Since v2.0, this is implemented using the order preserving transform defined in this paper from Microsoft: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/XboxInnerProduct.pdf -
Cosine
Cosine distance; i.e. normalized dot product. Computed by taking the sum of the products of each element of each vector, divided by the product of the magnitudes of each vector.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 nameNullPointerException
- if the argument is null
-