lenskit.basic.candidates.TrainingItemsCandidateSelector ======================================================= .. py:class:: lenskit.basic.candidates.TrainingItemsCandidateSelector(config = None, **kwargs) Bases: :py:obj:`lenskit.pipeline.Component`\ [\ :py:obj:`lenskit.data.ItemList`\ ], :py:obj:`lenskit.training.Trainable` Candidate selector that selects all known items from the training data, optionally excluding certain items from the query (i.e., the request user's history). In order to look up the user's history in the training data, this needs to be combined with a component like :class:`~.history.UserTrainingHistoryLookup`. :Stability: Caller .. py:attribute:: config :type: TrainingItemsCandidateConfig 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. .. py:attribute:: items :type: lenskit.data.Vocabulary List of known items from the training data. .. py:method:: is_trained() Query if this component has already been trained. .. py:method:: train(data, options = TrainingOptions()) Train the model to learn its parameters from a training dataset. :param data: The training dataset. :param options: The training options. .. py:method:: __call__(query) Run the pipeline's operation and produce a result. This is the key method for components to implement.