lenskit.flexmf.FlexMFScorerBase#
- class lenskit.flexmf.FlexMFScorerBase(config=None, **kwargs)#
Bases:
lenskit.training.UsesTrainer,lenskit.pipeline.ComponentBase class for the FlexMF scorers, providing common Torch support.
- Stability:
Experimental
- Parameters:
config (object | None)
kwargs (Any)
- config: FlexMFConfigBase#
The component configuration object. Component classes that support configuration must redefine this attribute with their specific configuration class type, which can be a Python dataclass or a Pydantic model class.
- users: lenskit.data.Vocabulary#
- items: lenskit.data.Vocabulary#
- model: lenskit.flexmf._model.FlexMFModel#
- to(device)#
Move the model to a different device.
- __call__(query, items)#
Generate item scores for a user.
Note that user and items are both user and item IDs, not positions.
- Parameters:
query (lenskit.data.QueryInput)
items (lenskit.data.ItemList)
- Return type:
- score_items(users, items)#
Score for users and items, after resolivng them and limiting to known users and items.
- Parameters:
users (torch.Tensor)
items (torch.Tensor)
- Return type: