@DefaultImplementation(value=ItemVectorSimilarity.class) public interface ItemSimilarity
Compute the similarity between two items.
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,
Long2DoubleMap v1,
long i2,
Long2DoubleMap v2)
Compute the similarity between two items.
|
double similarity(long i1, Long2DoubleMap v1, long i2, Long2DoubleMap v2)
Compute the similarity between two items.
i1
- The first item ID.v1
- The first item vector.i2
- The second item ID.v2
- The second item vector.boolean isSparse()
Query whether this similarity is sparse.
true
if the similarity function is sparse.VectorSimilarity.isSparse()
boolean isSymmetric()
Query whether this similarity is symmetric.
true
if the similarity function is symmetric.VectorSimilarity.isSymmetric()