lenskit.basic.candidates#

Classes

AllTrainingItemsCandidateSelector([config])

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

TrainingCandidateSelectorBase([config])

Base class for candidate selectors using the training data.

UnratedTrainingItemsCandidateSelector([config])

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(config=None, **kwargs)#

Bases: Component[ItemList, …], Trainable

Base class for candidate selectors using the training data.

Stability:
Caller (see Stability Levels).
Parameters:
  • config (None)

  • kwargs (Any)

items_: Vocabulary#

List of known items from the training data.

train(data, options=TrainingOptions(retrain=True, device=None, rng=None))#

Train the model to learn its parameters from a training dataset.

Parameters:
class lenskit.basic.candidates.AllTrainingItemsCandidateSelector(config=None, **kwargs)#

Bases: TrainingCandidateSelectorBase

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

Stability:
Caller (see Stability Levels).
Parameters:
  • config (None)

  • kwargs (Any)

class lenskit.basic.candidates.UnratedTrainingItemsCandidateSelector(config=None, **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.

Stability:
Caller (see Stability Levels).
Parameters:
  • config (None)

  • kwargs (Any)