lenskit.data.ItemListCollector#
- class lenskit.data.ItemListCollector#
Bases:
ProtocolCollect item lists with associated keys, as in
ItemListCollection.- abstractmethod add(list, *fields, **kwfields)#
Add a single item list to this list.
- Parameters:
list (lenskit.data._items.ItemList) – The item list to add.
fields (lenskit.data.types.ID) – The key fields for this list.
kwfields (lenskit.data.types.ID) – The key fields for this list.
- abstractmethod add_from(other, **fields)#
Add all collection from another collection to this collection. If field values are supplied, they are used to supplement or overwrite the keys in
other; a common use case is to add results from multiple recommendation runs and save them a single field.- Parameters:
other (ItemListCollection) – The item list collection to incorporate into this one.
fields (lenskit.data.types.ID) – Additional key fields (must be specified by name).