@DefaultProvider(value=ItemItemBuildContextProvider.class) @Shareable public class ItemItemBuildContext extends java.lang.Object implements java.io.Serializable
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
.
ItemItemModelBuilder
,
Serialized FormModifier and Type | Class and Description |
---|---|
class |
ItemItemBuildContext.ItemVecPair
A pair of item ids and their corresponding item
vectors, avoiding (un)boxing the ids.
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<ItemItemBuildContext.ItemVecPair> |
getItemPairIterator()
Returns an Iterator over all item vector pairs.
|
java.lang.Iterable<ItemItemBuildContext.ItemVecPair> |
getItemPairs()
Provides an Iterable over ItemVecPairs
|
LongSortedSet |
getItems()
Get the set of items.
|
LongSortedSet |
getUserItems(long user)
Get the items rated by a particular user.
|
SparseVector |
itemVector(long item)
Get the rating vector for an item.
|
@Nonnull public LongSortedSet getItems()
@Nonnull public SparseVector itemVector(long item)
VectorNormalizer
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)
user
- The user to query for.user
.public java.lang.Iterable<ItemItemBuildContext.ItemVecPair> getItemPairs()
public java.util.Iterator<ItemItemBuildContext.ItemVecPair> getItemPairIterator()