public class CosineSimilarityFunction extends AbstractCloneableSerializable implements SimilarityFunction<Vectorizable,Vectorizable>
Constructor and Description |
---|
CosineSimilarityFunction()
Creates a new
CosineSimilarityFunction . |
Modifier and Type | Method and Description |
---|---|
CosineDistanceMetric |
asDivergence()
Converts the similarity function into a divergence function.
|
double |
evaluate(Vectorizable from,
Vectorizable to)
Evaluates the similarity between the two given objects.
|
static CosineSimilarityFunction |
getInstance()
Gets a singleton instance of the class.
|
clone
public CosineSimilarityFunction()
CosineSimilarityFunction
.public static CosineSimilarityFunction getInstance()
public double evaluate(Vectorizable from, Vectorizable to)
SimilarityFunction
evaluate
in interface SimilarityFunction<Vectorizable,Vectorizable>
from
- The object the similarity is from.to
- The object the similarity is to.public CosineDistanceMetric asDivergence()
SimilarityFunction
asDivergence
in interface SimilarityFunction<Vectorizable,Vectorizable>