lenskit.batch ============= .. py:module:: lenskit.batch .. autoapi-nested-parse:: Batch-run recommendation pipelines for evaluation. Attributes ---------- .. autoapisummary:: lenskit.batch.BatchInput Classes ------- .. toctree:: :hidden: /api/lenskit/batch/BatchRecRequest /api/lenskit/batch/TestRequestAdapter /api/lenskit/batch/BatchResults /api/lenskit/batch/BatchPipelineRunner /api/lenskit/batch/InvocationSpec .. autoapisummary:: lenskit.batch.BatchRecRequest lenskit.batch.TestRequestAdapter lenskit.batch.BatchResults lenskit.batch.BatchPipelineRunner lenskit.batch.InvocationSpec Functions --------- .. autoapisummary:: lenskit.batch.predict lenskit.batch.recommend Package Contents ---------------- .. py:type:: BatchInput :canonical: Iterable[BatchRecRequest] | Iterable[RecQuery] | Iterable[ID | GenericKey] | ItemListCollection[GenericKey] Allowed input types for batch inference routines. .. py:function:: predict[K: lenskit.data.GenericKey](pipeline: lenskit.pipeline.Pipeline, test: lenskit.data.ItemListCollection[K], *, n_jobs: int | None = None, use_ray: bool | None = None) -> lenskit.data.ItemListCollection[K] predict(pipeline: lenskit.pipeline.Pipeline, test: _queries.BatchInput, *, n_jobs: int | None = None, use_ray: bool | None = None) -> lenskit.data.ItemListCollection[lenskit.data.GenericKey] Convenience function to batch-generate rating predictions (or other per-item scores) from a pipeline. This is a batch version of :func:`lenskit.predict`, and is a convenience wrapper around using a :meth:`BatchPipelineRunner` to generate predictions. .. note:: If ``test`` is just a sequence of IDs, this method will still work, but it will score _all candidate items_ for each of the IDs. :Stability: Caller .. py:function:: recommend[K: lenskit.data.GenericKey](pipeline: lenskit.pipeline.Pipeline, queries: lenskit.data.ItemListCollection[K], n: int | None = None, *, n_jobs: int | None = None, use_ray: bool | None = None, profiler: lenskit.pipeline.PipelineProfiler | None = None, users=None) -> lenskit.data.ItemListCollection[K] recommend(pipeline: lenskit.pipeline.Pipeline, queries: _queries.BatchInput, n: int | None = None, *, n_jobs: int | None = None, use_ray: bool | None = None, profiler: lenskit.pipeline.PipelineProfiler | None = None, users=None) -> lenskit.data.ItemListCollection[lenskit.data.GenericKey] Convenience function to batch-generate recommendations from a pipeline. This is a batch version of :func:`lenskit.recommend`, and is a convenience wrapper around using a :meth:`BatchPipelineRunner` to generate recommendations. .. seealso:: :meth:`BatchPipelineRunner.run` for details on the arguments, and :ref:`batch-queries` for details on the valid inputs for ``queries``. :param queries: The request queries. :Stability: Caller Exported Aliases ---------------- .. py:data:: lenskit.batch.GenericKey Re-exported alias for :py:data:`lenskit.data.GenericKey`. .. py:class:: lenskit.batch.ItemListCollection Re-exported alias for :py:class:`lenskit.data.ItemListCollection`. .. py:class:: lenskit.batch.Pipeline Re-exported alias for :py:class:`lenskit.pipeline.Pipeline`. .. py:class:: lenskit.batch.PipelineProfiler Re-exported alias for :py:class:`lenskit.pipeline.PipelineProfiler`.