lenskit.pipeline.RecPipelineBuilder#
- class lenskit.pipeline.RecPipelineBuilder#
Builder to help assemble common pipeline patterns.
This is a convenience class; you can always directly assemble a
Pipelineif this class’s behavior is inadquate.- Stability:
- Caller (see Stability Levels).
- scorer(score, config=None)#
Specify the scoring model.
- Parameters:
score (lenskit.pipeline.components.Component | lenskit.pipeline.components.ComponentConstructor)
config (object | None)
- ranker(rank=None, config=None, *, n=None)#
Specify the ranker to use. If
None, sets up aTopNRankerwithn=n.- Parameters:
rank (lenskit.pipeline.components.Component | lenskit.pipeline.components.ComponentConstructor | None)
config (object | None)
n (int | None)
- candidate_selector(sel, config=None)#
Specify the candidate selector component. The component should accept a query as its input and return an item list.
- Parameters:
sel (lenskit.pipeline.components.Component | lenskit.pipeline.components.ComponentConstructor)
config (object | None)
- predicts_ratings(*, transform=None, fallback=None)#
Specify that this pipeline will predict ratings, optionally providing a rating transformer and fallback scorer for the rating predictions.
- Parameters:
transform (lenskit.pipeline.components.Component | None) – A component to transform scores prior to returning them. If supplied, it will be applied to both primary scores and fallback scores.
fallback (lenskit.pipeline.components.Component | None) – A fallback scorer to use when the primary scorer cannot score an item. The fallback should accept
queryanditemsinputs, and return an item list.
- reranker(reranker, config=None)#
Specify a reranker to add to the pipeline.
- Parameters:
reranker (lenskit.pipeline.components.Component | lenskit.pipeline.components.ComponentConstructor) – The reranker to use in the pipeline.
config (object | None) – Configuration parameters to initialize the reranker if a reranker is specified.