pub enum DistanceCalculationMetric {
Euclidean,
Manhattan,
Minkowski,
}Expand description
Represents different distance calculation methods used in various machine learning algorithms.
This enum defines common distance metrics that can be used in clustering algorithms, nearest neighbor searches, and other applications where distance between points is relevant.
§Variants
Euclidean- Euclidean distance (L2 norm), calculated as the square root of the sum of squared differences between corresponding coordinates.Manhattan- Manhattan distance (L1 norm), calculated as the sum of absolute differences between corresponding coordinates.Minkowski- A generalized metric that includes both Euclidean and Manhattan distances as special cases. Requires an additional parameter p (not implemented in this enum).
Variants§
Euclidean
Euclidean distance (L2 norm) - the straight-line distance between two points.
Manhattan
Manhattan distance (L1 norm) - the sum of absolute differences between coordinates.
Minkowski
Minkowski distance - a generalized metric that includes both Euclidean and Manhattan distances.
Trait Implementations§
Source§impl Clone for DistanceCalculationMetric
impl Clone for DistanceCalculationMetric
Source§fn clone(&self) -> DistanceCalculationMetric
fn clone(&self) -> DistanceCalculationMetric
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DistanceCalculationMetric
impl Debug for DistanceCalculationMetric
impl StructuralPartialEq for DistanceCalculationMetric
Auto Trait Implementations§
impl Freeze for DistanceCalculationMetric
impl RefUnwindSafe for DistanceCalculationMetric
impl Send for DistanceCalculationMetric
impl Sync for DistanceCalculationMetric
impl Unpin for DistanceCalculationMetric
impl UnwindSafe for DistanceCalculationMetric
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