lenskit.basic.random.RandomSelector =================================== .. py:class:: lenskit.basic.random.RandomSelector(config = None, **kwargs) Bases: :py:obj:`lenskit.pipeline.Component`\ [\ :py:obj:`lenskit.data.ItemList`\ ] Randomly select items from a candidate list. :Stability: Caller :param n: The number of items to select, or ``-1`` to randomly permute the items. :param rng: The random number generator or specification (see :ref:`rng`). This class supports derivable RNGs. .. py:attribute:: config :type: RandomConfig 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:method:: __call__(items, query = None, n = None) :param items: The items from which to pick. :param query: The recommendation query; optional, and only consulted when the RNG seed is user-dependent. :param n: The number of items to select, overriding the configured value.