#[non_exhaustive]pub enum Metric {
Euclidean,
SqEuclidean,
Minkowski,
Manhattan,
Cosine,
}Expand description
Distance metric for pairwise_distances.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Euclidean
Euclidean distance (L2).
SqEuclidean
Squared Euclidean distance (Σ (xᵢ-yᵢ)² without the square root).
Minkowski
Minkowski distance with parameter p (defaults to L2 at p=2).
Manhattan
Manhattan / L1 / cityblock distance.
Cosine
Cosine distance: 1 - cos(angle).
Trait Implementations§
impl Copy for Metric
impl Eq for Metric
impl StructuralPartialEq for Metric
Auto Trait Implementations§
impl Forget for Metric
impl Freeze for Metric
impl Move for Metric
impl RefUnwindSafe for Metric
impl Send for Metric
impl Sync for Metric
impl Unpin for Metric
impl UnsafeUnpin for Metric
impl UnwindSafe for Metric
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more