lenskit.basic.bias.BiasScorer ============================= .. py:class:: lenskit.basic.bias.BiasScorer(config = None, **kwargs) Bases: :py:obj:`lenskit.pipeline.components.Component`\ [\ :py:obj:`lenskit.data.ItemList`\ ], :py:obj:`lenskit.training.Trainable` A user-item bias rating prediction model. This component uses :class:`BiasModel` to predict ratings for users and items. :param config: The component configuration. :Stability: Caller .. py:attribute:: config :type: BiasConfig 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:: model :type: BiasModel .. py:method:: is_trained() Query if this component has already been trained. .. py:method:: train(data, options = TrainingOptions()) Train the bias model on some rating data. :param ratings: The training data (must have ratings). :returns: The trained bias object. .. py:method:: __call__(query, items) Compute predictions for a user and items. Unknown users and items are assumed to have zero bias. :param query: The recommendation query. If the query has an item list with ratings, those ratings are used to compute a new bias instead of using the user's historical bias. :param items: The items to score. :returns: Scores for `items`.