Package it.unimi.dsi.law.vector
Class CosineSimilarityStrategy
java.lang.Object
it.unimi.dsi.law.vector.CosineSimilarityStrategy
- All Implemented Interfaces:
SimilarityStrategy
,Serializable
public class CosineSimilarityStrategy extends Object implements SimilarityStrategy
A class that compute the similarity between pattern using cosine similarity.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description CosineSimilarityStrategy()
-
Method Summary
Modifier and Type Method Description double
similarity(Vector v0, Vector v1)
Returns the similarity value between two vectors.
-
Constructor Details
-
CosineSimilarityStrategy
public CosineSimilarityStrategy()
-
-
Method Details
-
similarity
Description copied from interface:SimilarityStrategy
Returns the similarity value between two vectors.- Specified by:
similarity
in interfaceSimilarityStrategy
- Parameters:
v0
- the first vector.v1
- the second vector.- Returns:
- the similarity between vectors.
-