lenskit.data.MutableItemListCollection#
- class lenskit.data.MutableItemListCollection(key=None, *, index=True)#
Bases:
ItemListCollector,ItemListCollection[K],Generic[K]Intersection type of
ItemListCollectionandItemListCollector.- __init__(*args, **kwargs)#
Methods
__init__(*args, **kwargs)add(list, *fields, **kwfields)Add a single item list to this list.
add_from(other, **fields)Add all collection from another collection to this collection.
empty(key, *[, index])Create a new empty, mutable item list collection.
from_arrow(table)Convert an Arrow table into an item list collection. The table must be in ``'native`'' format.
from_df(df[, key])Create an item list collection from a data frame.
from_dict(data[, key])Create an item list collection from a dictionary.
items()Iterate over item lists and keys.
keys()Iterate over keys.
lists()Iterate over item lists without keys.
load_parquet(path[, key, layout])Load this item list from a Parquet file.
lookup(*args, **kwargs)Look up a list by key.
lookup_projected(key)Look up an item list using a projected key.
record_batches([batch_size, columns, layout])Get the item list collection as Arrow record batches (in native layout).
save_parquet(path, *[, layout, batch_size, ...])Save this item list collection to a Parquet file.
to_arrow(*[, batch_size, layout])Convert this item list collection to an Arrow table.
to_dataset([class_name, result])Construct a dataset populated with this item list collection's data as interactions.
to_df()Convert this item list collection to a data frame.
total_items()Count the total number of items across all lists in this collection.
Attributes
key_fieldsThe names of the key fields.
key_typeThe type of collection keys.
list_schemaGet the schema for the lists in this ILC.