public class SetCosineSimilarity extends SetSimilarity
data, dense
Constructor and Description |
---|
SetCosineSimilarity(FastPreferenceData<?,?> data,
double alpha,
boolean dense)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected double |
sim(int intersectionSize,
int nA,
int nB)
Calculates the similarity value.
|
similarElems, similarity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
similarity
public SetCosineSimilarity(FastPreferenceData<?,?> data, double alpha, boolean dense)
data
- preference dataalpha
- asymmetry of the similarity, set to 0.5 for standard cosinedense
- true for array-based calculations, false to map-basedprotected double sim(int intersectionSize, int nA, int nB)
SetSimilarity
sim
in class SetSimilarity
intersectionSize
- size of the intersection of setsnA
- size of the first setnB
- size of the second setCopyright © 2016. All rights reserved.