Skip to main content

cosine_sim

Function cosine_sim 

Source
pub fn cosine_sim(a: &[f64], b: &[f64]) -> f64
Expand description

Cosine similarity between two vectors. Returns 0.0 when either vector has zero magnitude or the lengths differ.