public class CosineSimilarity extends Object
For further explanation about the Cosine Similarity, refer to http://en.wikipedia.org/wiki/Cosine_similarity.
Constructor and Description |
---|
CosineSimilarity() |
Modifier and Type | Method and Description |
---|---|
Double |
cosineSimilarity(Map<CharSequence,Integer> leftVector,
Map<CharSequence,Integer> rightVector)
Calculates the cosine similarity for two given vectors.
|
public CosineSimilarity()
public Double cosineSimilarity(Map<CharSequence,Integer> leftVector, Map<CharSequence,Integer> rightVector)
leftVector
- left vectorrightVector
- right vectorCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.