VectorMetric enum
Similarity / distance metric identifiers. Mirrors FAISS's
METRIC_L2 / METRIC_INNER_PRODUCT; cosine is inner-product on
pre-normalized vectors and is exposed as a distance (1 - similarity).
Values
- l2sq → const VectorMetric
-
Squared Euclidean distance. Cheapest to compute and monotone in L2, so it is what the flat index ranks on internally.
- l2 → const VectorMetric
-
Euclidean distance (√l2sq).
- innerProduct → const VectorMetric
-
Inner (dot) product. Larger = more similar; the k-NN search therefore keeps the k LARGEST scores here.
- cosine → const VectorMetric
-
Cosine distance = 1 − (a·b)/(‖a‖·‖b‖). Range
0, 2.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
VectorMetric> - A constant List of the values in this enum, in order of their declaration.