@Shareable public class ItemVectorSimilarity extends java.lang.Object implements ItemSimilarity, java.io.Serializable, MaybeThreadSafe
Implementation of ItemSimilarity that delegates to a vector similarity.
| Constructor and Description |
|---|
ItemVectorSimilarity(VectorSimilarity sim) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isSparse()
Query whether this similarity is sparse.
|
boolean |
isSymmetric()
Query whether this similarity is symmetric.
|
boolean |
isThreadSafe()
Query whether this object is thread-safe.
|
double |
similarity(long i1,
Long2DoubleMap v1,
long i2,
Long2DoubleMap v2)
Compute the similarity between two items.
|
java.lang.String |
toString() |
@Inject public ItemVectorSimilarity(VectorSimilarity sim)
public double similarity(long i1,
Long2DoubleMap v1,
long i2,
Long2DoubleMap v2)
ItemSimilarityCompute the similarity between two items.
similarity in interface ItemSimilarityi1 - The first item ID.v1 - The first item vector.i2 - The second item ID.v2 - The second item vector.public boolean isSparse()
ItemSimilarityQuery whether this similarity is sparse.
isSparse in interface ItemSimilaritytrue if the similarity function is sparse.VectorSimilarity.isSparse()public boolean isSymmetric()
ItemSimilarityQuery whether this similarity is symmetric.
isSymmetric in interface ItemSimilaritytrue if the similarity function is symmetric.VectorSimilarity.isSymmetric()public boolean isThreadSafe()
MaybeThreadSafeQuery whether this object is thread-safe.
isThreadSafe in interface MaybeThreadSafetrue if the object is thread-safe.public java.lang.String toString()
toString in class java.lang.Object