@DefaultProvider(value=ItemItemBuildContextProvider.class) @Shareable public class ItemItemBuildContext extends java.lang.Object implements java.io.Serializable
Encapsulation of data needed during an item-item model build. This class provides access to item vectors and the item universe for use in building up the model in the accumulator.
This is shareable to make it more usable in the evaluator. Typical built models
will not include it, and any dependencies on it should be Transient
.
ItemItemModelProvider
,
Serialized FormModifier and Type | Method and Description |
---|---|
LongSortedSet |
getItems()
Get the set of items.
|
LongSortedSet |
getUserItems(long user)
Get the items rated by a particular user.
|
Long2DoubleSortedMap |
itemVector(long item)
Get the rating vector for an item.
|
@Nonnull public LongSortedSet getItems()
Get the set of items.
@Nonnull public Long2DoubleSortedMap itemVector(long item)
Get the rating vector for an item. Rating vectors contain normalized ratings, using the applicable user-vector normalizer on the user rating vectors.
item
- The item to query.item
.java.lang.IllegalArgumentException
- if item
is not a valid item.@Nonnull public LongSortedSet getUserItems(long user)
Get the items rated by a particular user.
user
- The user to query for.user
.