lenskit.operations#

Top-level LensKit functions for recommender operations.

Functions#

recommend(pipeline, query[, n, items, component, profiler])

Generate recommendations for a user or query. This calls the specified

score(pipeline, query, items, *[, component, profiler])

Score items with respect to a user or query. This calls the specified

predict(pipeline, query, items, *[, component, profiler])

Predict ratings for items. This is exactly like score(), except it

Module Contents#

lenskit.operations.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 (see Stability Levels).
Parameters:
Returns:

The recommended items as an ordered item list.

Return type:

lenskit.data.ItemList

lenskit.operations.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 (see Stability Levels).
Parameters:
Returns:

The items with scores in the score field.

Return type:

lenskit.data.ItemList

lenskit.operations.predict(pipeline, query, items, *, component='rating-predictor', profiler=None)#

Predict ratings for items. This is exactly like 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 (see Stability Levels).
Parameters:
Return type:

lenskit.data.ItemList

Exported Aliases#

class lenskit.operations.ItemList#

Re-exported alias for lenskit.data.ItemList.

lenskit.operations.QueryInput#

Re-exported alias for lenskit.data.QueryInput.

lenskit.operations.IDSequence#

Re-exported alias for lenskit.data.types.IDSequence.

class lenskit.operations.Pipeline#

Re-exported alias for lenskit.pipeline.Pipeline.

class lenskit.operations.PipelineProfiler#

Re-exported alias for lenskit.pipeline.PipelineProfiler.