public class VectorCosineSimilarity extends VectorSimilarity
data, dense, norm2Array, norm2Map| Constructor and Description |
|---|
VectorCosineSimilarity(FastPreferenceData<?,?> data,
double alpha,
boolean dense)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
sim(double product,
double norm2A,
double norm2B)
Calculates the similarity value.
|
similarElems, similarityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsimilaritypublic VectorCosineSimilarity(FastPreferenceData<?,?> data, double alpha, boolean dense)
data - preference dataalpha - asymmetry of the similarity, set to 0.5 for symmetrydense - true for array-based calculations, false to map-basedprotected double sim(double product,
double norm2A,
double norm2B)
VectorSimilaritysim in class VectorSimilarityproduct - value of the inner product of vectorsnorm2A - square of the norm of the first vectornorm2B - square of the norm of the second vectorCopyright © 2016. All rights reserved.