rust-ndarray / ndarray-stats

Statistical routines for ndarray
https://docs.rs/ndarray-stats
Apache License 2.0
198 stars 25 forks source link

cosine similarity and other distance measures #61

Open xd009642 opened 4 years ago

xd009642 commented 4 years ago

Title is fairly self explanatory, I've found the need for cosine distance at various times (and other distance metrics) that probably fit well in ndarray-stats. Maybe here we can decided on a few different ones and what is/isn't in scope for this crate

LukeMathWalker commented 4 years ago

Cosine similarity would fit quite well in the scope - we already have a bunch of distance functions, so we can definitely expand the collection. What else do you have in mind?

xd009642 commented 4 years ago

Hmm only other distance function I've made use of in my day to day has been KL divergence, I'm sure there's other common ones though :smile:

LukeMathWalker commented 4 years ago

https://docs.rs/ndarray-stats/0.3.0/ndarray_stats/trait.EntropyExt.html#tymethod.kl_divergence :grin:

xd009642 commented 4 years ago

Oh well that's an easy one to cross off then :joy:

Do you have any other distance metrics in mind?

beyarkay commented 7 months ago

Just wanted to check in on this issue? Adding cosine similarity seems like something I could do so I might take a crack if there's no other constraints.