@DefaultProvider(value=ItemItemModelBuilder.class) @Shareable public class SimilarityMatrixModel extends java.lang.Object implements java.io.Serializable, ItemItemModel
These similarities are post-normalization, so code using them should use the same normalizations used by the builder to make use of the similarity scores.
Constructor and Description |
---|
SimilarityMatrixModel(LongKeyDomain items,
java.util.List<java.util.List<ScoredId>> nbrs)
Deprecated.
This is deprecated for public usage. It is better to use the other constructor.
|
SimilarityMatrixModel(java.util.Map<java.lang.Long,java.util.List<ScoredId>> nbrs)
Construct a new item-item model.
|
Modifier and Type | Method and Description |
---|---|
LongSortedSet |
getItemUniverse()
Get the set of all items in the model.
|
java.util.List<ScoredId> |
getNeighbors(long item)
Get the neighbors of an item scored by similarity.
|
java.lang.String |
toString() |
@Deprecated public SimilarityMatrixModel(LongKeyDomain items, java.util.List<java.util.List<ScoredId>> nbrs)
items
- The item domain.nbrs
- The item neighborhoods.public SimilarityMatrixModel(java.util.Map<java.lang.Long,java.util.List<ScoredId>> nbrs)
nbrs
- The item neighborhoods.public LongSortedSet getItemUniverse()
ItemItemModel
getItemUniverse
in interface ItemItemModel
@Nonnull public java.util.List<ScoredId> getNeighbors(long item)
ItemItemModel
org.grouplens.lenskit.knn.item
).getNeighbors
in interface ItemItemModel
item
- The item to get the neighborhood for.public java.lang.String toString()
toString
in class java.lang.Object