@DefaultProvider(value=ItemItemModelBuilder.class) @Shareable public class SimilarityMatrixModel extends Object implements 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,
List<ImmutableSparseVector> nbrs)
Deprecated.
This is deprecated for public usage. It is better to use the other constructor.
|
SimilarityMatrixModel(Map<Long,ImmutableSparseVector> nbrs)
Construct a new item-item model.
|
Modifier and Type | Method and Description |
---|---|
LongSortedSet |
getItemUniverse()
Get the set of all items in the model.
|
SparseVector |
getNeighbors(long item)
Get the neighbors of an item scored by similarity.
|
String |
toString() |
@Deprecated public SimilarityMatrixModel(LongKeyDomain items, List<ImmutableSparseVector> nbrs)
items
- The item domain.nbrs
- The item neighborhoods.public SimilarityMatrixModel(Map<Long,ImmutableSparseVector> nbrs)
nbrs
- The item neighborhoods. The item neighborhood lists are not copied.public LongSortedSet getItemUniverse()
ItemItemModel
getItemUniverse
in interface ItemItemModel
@Nonnull public SparseVector getNeighbors(long item)
ItemItemModel
org.grouplens.lenskit.knn.item
).getNeighbors
in interface ItemItemModel
item
- The item to get the neighborhood for.