lenskit.pipeline.RecPipelineBuilder#
- class lenskit.pipeline.RecPipelineBuilder#
Bases:
objectBuilder 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).
- __init__()#
Methods
__init__()build([name])Build the specified pipeline.
candidate_selector(sel[, config])Specify the candidate selector component.
predicts_ratings(*[, transform, fallback])Specify that this pipeline will predict ratings, optionally providing a rating transformer and fallback scorer for the rating predictions.
ranker([rank, config, n])Specify the ranker to use.
reranker(reranker[, config])Specify a reranker to add to the pipeline.
scorer(score[, config])Specify the scoring model.
Attributes
is_predictor- scorer(score, config=None)#
Specify the scoring model.
- ranker(rank=None, config=None, *, n=None)#
Specify the ranker to use. If
None, sets up aTopNRankerwithn=n.
- candidate_selector(sel, config=None)#
Specify the candidate selector component. The component should accept a query as its input and return an item list.
- 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 (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 (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.