@DefaultProvider(value=ItemItemBuildContextProvider.class) @Shareable public class ItemItemBuildContext extends Object implements 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 | 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 |
---|---|
Iterator<ItemItemBuildContext.ItemVecPair> |
getItemPairIterator()
Deprecated.
This will go away in LensKit 3.0.
|
Iterable<ItemItemBuildContext.ItemVecPair> |
getItemPairs()
Deprecated.
This will go away in LensKit 3.0.
|
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()
Get the set of items.
@Nonnull public SparseVector 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
.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
.@Deprecated public Iterable<ItemItemBuildContext.ItemVecPair> getItemPairs()
Provides an Iterable over ItemVecPairs
@Deprecated public Iterator<ItemItemBuildContext.ItemVecPair> getItemPairIterator()
Returns an Iterator over all item vector pairs.