pub struct Cosine {}Expand description
Cosine similarity is the cosine of the angle between two vectors.
This is how many symbols the given strings have in common divided by the square root of the product of the strings’ lengths.
Trait Implementations§
Source§impl Algorithm<f64> for Cosine
impl Algorithm<f64> for Cosine
Source§fn for_iter<C, E>(&self, s1: C, s2: C) -> Result<f64>
fn for_iter<C, E>(&self, s1: C, s2: C) -> Result<f64>
Calculate distance/similarity for iterators. Read more
Source§fn for_vec<E>(&self, s1: &[E], s2: &[E]) -> Result<R>
fn for_vec<E>(&self, s1: &[E], s2: &[E]) -> Result<R>
Calculate distance/similarity for vectors. Read more
Source§fn for_str(&self, s1: &str, s2: &str) -> Result<R>
fn for_str(&self, s1: &str, s2: &str) -> Result<R>
Calculate distance/similarity for strings. Read more
Auto Trait Implementations§
impl Freeze for Cosine
impl RefUnwindSafe for Cosine
impl Send for Cosine
impl Sync for Cosine
impl Unpin for Cosine
impl UnwindSafe for Cosine
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