Find cosine similarity between two arrays

后端 未结 6 1482
忘掉有多难
忘掉有多难 2020-11-27 13:28

I\'m wondering if there is a built in function in R that can find the cosine similarity (or cosine distance) between two arrays?

Currently, I implemented my own func

6条回答
  •  时光说笑
    2020-11-27 13:42

    You can also check the vegan package: http://cran.r-project.org/web/packages/vegan//index.html

    The function vegdist in this package has a variety of dissimilarity (distance) functions, such as manhattan, euclidean, canberra, bray, kulczynski, jaccard, gower, altGower, morisita, horn,mountford, raup , binomial, chao or cao. Please check the .pdf in the package for a definition or consult references https://stats.stackexchange.com/a/33001/12733.

提交回复
热议问题