lenskit.splitting.SampleN ========================= .. py:class:: lenskit.splitting.SampleN(n, rng = None) :canonical: lenskit.splitting._holdout.SampleN Bases: :py:obj:`HoldoutMethod` Randomly select a fixed number of test rows per user/item. :Stability: Caller :param n: The number of test items to select. :param rng: The random number generator or seed (see :ref:`rng`). .. py:attribute:: n :type: int .. py:attribute:: rng :type: numpy.random.Generator .. py:method:: __call__(items) Subset an item list (in the uncommon case of item-based holdouts, the item list actually holds user IDs). :param udf: The item list from which holdout items should be selected. :returns: The list of test items.