pub enum WeightingStrategy {
Uniform,
Distance,
}Expand description
Represents the strategy used for weighting neighbors in KNN algorithm.
§Variants
Uniform- Each neighbor is weighted equallyDistance- Neighbors are weighted by the inverse of their distance (closer neighbors have greater influence)
Variants§
Uniform
All neighbors are weighted equally regardless of their distance to the query point.
Distance
Neighbors are weighted by the inverse of their distance, giving closer neighbors more influence on the prediction.
Trait Implementations§
Source§impl Clone for WeightingStrategy
impl Clone for WeightingStrategy
Source§fn clone(&self) -> WeightingStrategy
fn clone(&self) -> WeightingStrategy
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 WeightingStrategy
impl Debug for WeightingStrategy
Source§impl PartialEq for WeightingStrategy
impl PartialEq for WeightingStrategy
impl StructuralPartialEq for WeightingStrategy
Auto Trait Implementations§
impl Freeze for WeightingStrategy
impl RefUnwindSafe for WeightingStrategy
impl Send for WeightingStrategy
impl Sync for WeightingStrategy
impl Unpin for WeightingStrategy
impl UnwindSafe for WeightingStrategy
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