lenskit.operations ================== .. py:module:: lenskit.operations .. autoapi-nested-parse:: Top-level LensKit functions for recommender operations. Functions --------- .. autoapisummary:: lenskit.operations.recommend lenskit.operations.score lenskit.operations.predict Module Contents --------------- .. py:function:: recommend(pipeline, query, n = None, items = None, *, component = 'recommender', profiler = None) Generate recommendations for a user or query. This calls the specified pipeline component (the ``'recommender'`` by default) and returns the resulting item list. :Stability: full :param pipeline: The pipeline to run. :param query: The user ID or other query data for the recommendation. :param n: The number of items to recommend. :param items: The candidate items, or ``None`` to use the pipeline's default candidate selector. :param component: The name of the component implementing the recommender. :param profiler: A profiler for profiling this pipeline run. :returns: The recommended items as an ordered item list. .. py:function:: score(pipeline, query, items, *, component = 'scorer', profiler = None) Score items with respect to a user or query. This calls the specified pipeline component (the ``'scorer'`` by default) and returns the resulting item list. :Stability: Full :param pipeline: The pipeline to run. :param query: The user ID or other query data for the recommendation. :param items: The candidate items, or ``None`` to use the pipeline's default candidate selector. :param component: The name of the component implementing the scorer. :returns: The items with scores in the ``score`` field. .. py:function:: predict(pipeline, query, items, *, component = 'rating-predictor', profiler = None) Predict ratings for items. This is exactly like :func:`score`, except it defaults to the ``'rating-predictor'`` component. In a standard pipeline, the rating predictor may have additional configuration such as fallbacks or transformations to ensure every item is scored and the scores are valid rating predictions; the scorer typically returns raw scores. :Stability: Full Exported Aliases ---------------- .. py:class:: lenskit.operations.ItemList Re-exported alias for :py:class:`lenskit.data.ItemList`. .. py:data:: lenskit.operations.QueryInput Re-exported alias for :py:data:`lenskit.data.QueryInput`. .. py:data:: lenskit.operations.IDSequence Re-exported alias for :py:data:`lenskit.data.types.IDSequence`. .. py:class:: lenskit.operations.Pipeline Re-exported alias for :py:class:`lenskit.pipeline.Pipeline`. .. py:class:: lenskit.operations.PipelineProfiler Re-exported alias for :py:class:`lenskit.pipeline.PipelineProfiler`.