org.grouplens.lenskit.knn.item.model

## Interface ItemItemModel

• All Known Implementing Classes:
SimilarityMatrixModel

@DefaultImplementation(value=SimilarityMatrixModel.class)
public interface ItemItemModel
Item-item similarity model. It makes available the similarities between items in the form of allowing queries to neighborhoods.

These similarities are post-normalization, so code using them should typically use the same normalizations used by the builder to make use of the similarity scores.

Since:
0.10 as an interface.
• ### Method Summary

All Methods
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.
• ### Method Detail

• #### getItemUniverse

LongSortedSet getItemUniverse()
Get the set of all items in the model.
Returns:
The set of item IDs for all items in the model.
• #### getNeighbors

@Nonnull
SparseVector getNeighbors(long item)
Get the neighbors of an item scored by similarity. This is the corresponding row of the item-item similarity matrix (see org.grouplens.lenskit.knn.item).
Parameters:
item - The item to get the neighborhood for.
Returns:
The row of the similarity matrix. If the item is unknown, an empty vector is returned.