标签:
The cosine of two vectors can be derived by using the Euclidean dot product formula:
Given two vectors of attributes, A and B, the cosine similarity, cos(θ), is represented using a dot product and magnitude as
The resulting similarity ranges from ?1 meaning exactly opposite, to 1 meaning exactly the same, with 0 usually indicating independence, and in-between values indicating intermediate similarity or dissimilarity.
spark MLlib 概念 5: 余弦相似度(Cosine similarity)
标签:
原文地址:http://www.cnblogs.com/zwCHAN/p/4265882.html