lenskit.pipeline.topn_pipeline#

lenskit.pipeline.topn_pipeline(scorer, *, predicts_ratings=False)#

Create a pipeline that produces top-N recommendations using the specified scorer. The scorer should have the following call signature:

def scorer(user: UserHistory, items: ItemList) -> pd.Series: ...
Parameters:
  • scorer (Callable[[...], Series]) – The scorer to use in the pipeline (it will added with the component name score, see Component Names).

  • predicts_ratings (bool) – If True, make predict-ratings an alias for score so that evaluation components know this pipeline can predict ratings.

Return type:

Pipeline