lenskit.hpf.HPFScorer ===================== .. py:class:: lenskit.hpf.HPFScorer(config = None, **kwargs) Bases: :py:obj:`lenskit.pipeline.Component`\ [\ :py:obj:`lenskit.data.ItemList`\ ], :py:obj:`lenskit.training.Trainable` Hierarchical Poisson factorization, provided by `hpfrec`_ .. _hpfrec: https://hpfrec.readthedocs.io/en/latest/ .. todo:: Right now, this uses the 'rating' as a count. Actually use counts (:issue:`656`). :Stability: Experimental :param features: the number of features :param kwargs: additional arguments to pass to :class:`hpfrec.HPF`. .. py:attribute:: config :type: HPFConfig 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:: users :type: lenskit.data.Vocabulary .. py:attribute:: user_features :type: numpy.ndarray[tuple[int, int], numpy.dtype[numpy.float64]] .. py:attribute:: items :type: lenskit.data.Vocabulary .. py:attribute:: item_features :type: numpy.ndarray[tuple[int, int], numpy.dtype[numpy.float64]] .. 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, items) Run the pipeline's operation and produce a result. This is the key method for components to implement.