Package com.google.datastore.v1
Enum FindNearest.DistanceMeasure
- All Implemented Interfaces:
com.google.protobuf.Internal.EnumLite,com.google.protobuf.ProtocolMessageEnum,Serializable,Comparable<FindNearest.DistanceMeasure>
- Enclosing class:
- FindNearest
public static enum FindNearest.DistanceMeasure
extends Enum<FindNearest.DistanceMeasure>
implements com.google.protobuf.ProtocolMessageEnum
The distance measure to use when comparing vectors.Protobuf enum
google.datastore.v1.FindNearest.DistanceMeasure-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCOSINE distance compares vectors based on the angle between them, which allows you to measure similarity that isn't based on the vectors magnitude.Should not be set.Similar to cosine but is affected by the magnitude of the vectors.Measures the EUCLIDEAN distance between the vectors. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCOSINE distance compares vectors based on the angle between them, which allows you to measure similarity that isn't based on the vectors magnitude.static final intShould not be set.static final intSimilar to cosine but is affected by the magnitude of the vectors.static final intMeasures the EUCLIDEAN distance between the vectors. -
Method Summary
Modifier and TypeMethodDescriptionstatic FindNearest.DistanceMeasureforNumber(int value) static final com.google.protobuf.Descriptors.EnumDescriptorfinal com.google.protobuf.Descriptors.EnumDescriptorfinal intfinal com.google.protobuf.Descriptors.EnumValueDescriptorstatic com.google.protobuf.Internal.EnumLiteMap<FindNearest.DistanceMeasure>static FindNearest.DistanceMeasurevalueOf(int value) Deprecated.static FindNearest.DistanceMeasurevalueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) Returns the enum constant of this type with the specified name.static FindNearest.DistanceMeasureReturns the enum constant of this type with the specified name.static FindNearest.DistanceMeasure[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DISTANCE_MEASURE_UNSPECIFIED
Should not be set.
DISTANCE_MEASURE_UNSPECIFIED = 0; -
EUCLIDEAN
Measures the EUCLIDEAN distance between the vectors. See [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn more. The resulting distance decreases the more similar two vectors are.
EUCLIDEAN = 1; -
COSINE
COSINE distance 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 about COSINE similarity and COSINE distance. The resulting COSINE distance decreases the more similar two vectors are.
COSINE = 2; -
DOT_PRODUCT
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. The resulting distance increases the more similar two vectors are.
DOT_PRODUCT = 3; -
UNRECOGNIZED
-
-
Field Details
-
DISTANCE_MEASURE_UNSPECIFIED_VALUE
public static final int DISTANCE_MEASURE_UNSPECIFIED_VALUEShould not be set.
DISTANCE_MEASURE_UNSPECIFIED = 0;- See Also:
-
EUCLIDEAN_VALUE
public static final int EUCLIDEAN_VALUEMeasures the EUCLIDEAN distance between the vectors. See [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn more. The resulting distance decreases the more similar two vectors are.
EUCLIDEAN = 1;- See Also:
-
COSINE_VALUE
public static final int COSINE_VALUECOSINE distance 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 about COSINE similarity and COSINE distance. The resulting COSINE distance decreases the more similar two vectors are.
COSINE = 2;- See Also:
-
DOT_PRODUCT_VALUE
public static final int DOT_PRODUCT_VALUESimilar to cosine but is affected by the magnitude of the vectors. See [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more. The resulting distance increases the more similar two vectors are.
DOT_PRODUCT = 3;- See Also:
-
-
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
-
getNumber
public final int getNumber()- Specified by:
getNumberin interfacecom.google.protobuf.Internal.EnumLite- Specified by:
getNumberin interfacecom.google.protobuf.ProtocolMessageEnum
-
valueOf
Deprecated.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:
value- 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
-
forNumber
- Parameters:
value- The numeric wire value of the corresponding enum entry.- Returns:
- The enum associated with the given numeric wire value.
-
internalGetValueMap
public static com.google.protobuf.Internal.EnumLiteMap<FindNearest.DistanceMeasure> internalGetValueMap() -
getValueDescriptor
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()- Specified by:
getValueDescriptorin interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptorForType
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.ProtocolMessageEnum
-
getDescriptor
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() -
valueOf
public static FindNearest.DistanceMeasure valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) 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:
desc- 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
-