@DefaultImplementation(value=ItemVectorSimilarity.class) public interface ItemSimilarity
Modifier and Type | Method and Description |
---|---|
boolean |
isSparse()
Query whether this similarity is sparse.
|
boolean |
isSymmetric()
Query whether this similarity is symmetric.
|
double |
similarity(long i1,
SparseVector v1,
long i2,
SparseVector v2)
Compute the similarity between two items.
|
double similarity(long i1, SparseVector v1, long i2, SparseVector v2)
i1
- The first item ID.v1
- The first item vector.i2
- The second item ID.v2
- The second item vector.boolean isSparse()
true
if the similarity function is sparse.VectorSimilarity.isSparse()
boolean isSymmetric()
true
if the similarity function is symmetric.VectorSimilarity.isSymmetric()