lenskit.basic.candidates#

Classes

AllTrainingItemsCandidateSelector(*args, ...)

Candidate selector that selects all known items from the training data.

TrainingCandidateSelectorBase(*args, **kwargs)

Base class for candidate selectors using the training data.

UnratedTrainingItemsCandidateSelector(*args, ...)

Candidate selector that selects all known items from the training data that do not appear in the request user's history (RecQuery.user_items).

class lenskit.basic.candidates.TrainingCandidateSelectorBase(*args, **kwargs)#

Bases: Component, Trainable

Base class for candidate selectors using the training data.

property is_trained: bool#

Check if this model has already been trained.

train(data)#

Train the pipeline component to learn its parameters from a training dataset.

Parameters:
  • data (Dataset) – The training dataset.

  • retrain – If True, retrain the model even if it has already been trained.

class lenskit.basic.candidates.AllTrainingItemsCandidateSelector(*args, **kwargs)#

Bases: TrainingCandidateSelectorBase

Candidate selector that selects all known items from the training data.

class lenskit.basic.candidates.UnratedTrainingItemsCandidateSelector(*args, **kwargs)#

Bases: TrainingCandidateSelectorBase

Candidate selector that selects all known items from the training data that do not appear in the request user’s history (RecQuery.user_items). If no item history is available, then all training items are returned.

In order to look up the user’s history in the training data, this needs to be combined with a component like UserTrainingHistoryLookup.