lenskit.basic.topn#
Basic Top-N ranking.
Classes
|
Configuration for top-N ranking. |
|
Rank scored items by their score and take the top N. |
- class lenskit.basic.topn.TopNConfig(*, n=None)#
Bases:
BaseModel
Configuration for top-N ranking.
- Parameters:
n (int | None)
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class lenskit.basic.topn.TopNRanker(config=None, **kwargs)#
Bases:
Component
[ItemList
, …]Rank scored items by their score and take the top N. The ranking length can be passed either at runtime or at component instantiation time, with the latter taking precedence.
- Stability:
- Caller (see Stability Levels).
- Parameters:
config (TopNConfig)
kwargs (Any)