public abstract class SetSimilarity extends Object implements Similarity
| Modifier and Type | Field and Description |
|---|---|
protected FastPreferenceData<?,?> |
data
User-item preferences.
|
protected boolean |
dense
If true dense vectors are used to calculate similarities.
|
| Constructor and Description |
|---|
SetSimilarity(FastPreferenceData<?,?> data,
boolean dense)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract double |
sim(int intersectionSize,
int na,
int nb)
Calculates the similarity value.
|
Stream<Tuple2id> |
similarElems(int idx1)
Returns all the users/items having a similarity greater than 0,
together with the value of the similarity.
|
IntToDoubleFunction |
similarity(int idx1)
Returns a function that returns the similarity with the user/item.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsimilarityprotected final FastPreferenceData<?,?> data
protected final boolean dense
public SetSimilarity(FastPreferenceData<?,?> data, boolean dense)
data - preference datadense - true for array-based calculations, false to map-basedpublic IntToDoubleFunction similarity(int idx1)
Similaritysimilarity in interface Similarityidx1 - index of the user/itempublic Stream<Tuple2id> similarElems(int idx1)
SimilaritysimilarElems in interface Similarityidx1 - index of user/itemprotected abstract double sim(int intersectionSize,
int na,
int nb)
intersectionSize - size of the intersection of setsna - size of the first setnb - size of the second setCopyright © 2016. All rights reserved.