lenskit.data.RecQuery#
- class lenskit.data.RecQuery(user_id=None, user_items=None)#
Bases:
objectRepresentation of a the data available for a recommendation query. This is generally the available inputs for a recommendation request except the set of candidate items.
Todo
Document and test methods for extending the recommendation query with arbitrary data to be used by client-provided pipeline components.
Todo
When LensKit supports context-aware recommendation, this should be extended to include context cues.
- Stability:
- Caller (see Stability Levels).
- Parameters:
- __init__(user_id=None, user_items=None)#
Methods
__init__([user_id, user_items])create(data)Create a recommenadtion query from an input, filling in available components based on the data type.
Attributes
The user's identifier.
The items from the user's interaction history, with ratings if available.
- user_id: int | str | bytes | integer[Any] | str_ | bytes_ | object_ | None = None#
The user’s identifier.
- user_items: ItemList | None = None#
The items from the user’s interaction history, with ratings if available. This list is deduplicated, like
interaction_matrix(), rather than a full interaction log. As withuser_row(), the rating is expected to be on aratingfield, notscore.
- classmethod create(data)#
Create a recommenadtion query from an input, filling in available components based on the data type.