ndarray-stats icon indicating copy to clipboard operation
ndarray-stats copied to clipboard

cosine similarity and other distance measures

Open xd009642 opened this issue 5 years ago • 5 comments

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

xd009642 avatar Mar 19 '20 11:03 xd009642

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?

LukeMathWalker avatar Mar 20 '20 13:03 LukeMathWalker

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:

xd009642 avatar Mar 20 '20 14:03 xd009642

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

LukeMathWalker avatar Mar 20 '20 16:03 LukeMathWalker

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

Do you have any other distance metrics in mind?

xd009642 avatar Mar 20 '20 16:03 xd009642

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.

beyarkay avatar Feb 08 '24 12:02 beyarkay