Skip to content

Ranker

Base class for ranking models.

Parameters

  • seed

    Typeint | None

    DefaultNone

    Random number generation seed. Set this for reproducibility.

Attributes

  • is_contextual

Methods

learn_one

Fits a user-item pair and a real-valued target y.

Parameters

  • user'ID'
  • item'ID'
  • y'Reward'
  • x'dict | None' — defaults to None

predict_one

Predicts the target value of a set of features x.

Parameters

  • user'ID'
  • item'ID'
  • x'dict | None' — defaults to None

Returns

Reward: The predicted preference from the user for the item.

rank

Rank models by decreasing order of preference for a given user.

Parameters

  • user'ID'
  • items'set[ID]'
  • x'dict | None' — defaults to None