VectorMetric enum
Similarity metric used to order neighbours.
The indices are the wire values phoenix_vector_init expects and must
never be reordered.
Values
- cosine → const VectorMetric
-
Angular distance,
1 - cos(a, b), in[0, 2].Scale-invariant, and the right default for text embeddings, which are almost always trained with a cosine objective.
const VectorMetric(0, 'cosine') - euclidean → const VectorMetric
-
Straight-line (L2) distance, in
[0, infinity).const VectorMetric(1, 'euclidean') - dotProduct → const VectorMetric
-
Inner product. Unlike the other two, magnitude matters — use it only when vector length is meaningful, as in a MIPS recommender.
const VectorMetric(2, 'dotProduct')
Properties
- code → int
-
Value passed to
phoenix_vector_init.final - hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- label → String
-
Human-readable name, used in diagnostics.
final
- 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.