lenskit.als.BiasedMFScorer#

class lenskit.als.BiasedMFScorer(config=None, **kwargs)#

Bases: lenskit.als._common.ALSBase

Biased matrix factorization trained with alternating least squares [PilaszyZT10, ZWSP08]. This is a prediction-oriented algorithm suitable for explicit feedback data, using the alternating least squares approach to compute \(P\) and \(Q\) to minimize the regularized squared reconstruction error of the ratings matrix.

See the base class ALSBase for documentation on the estimated parameters you can extract from a trained model. See BiasedMFConfig and ALSConfig for the configuration options for this component.

Stability:
Caller (see Stability Levels).
Parameters:
  • config (object | None)

  • kwargs (Any)

config: BiasedMFConfig#

The component configuration object. Component classes that support configuration must redefine this attribute with their specific configuration class type, which can be a Python dataclass or a Pydantic model class.

bias: lenskit.basic.BiasModel#
create_trainer(data, options)#

Create a model trainer to train this model.

new_user_embedding(user_num, items)#

Generate an embedding for a user given their current ratings.

Parameters:
Return type:

tuple[lenskit.data.types.NPVector, float | None]

finalize_scores(user_num, items, user_bias)#

Perform any final transformation of scores prior to returning them.

Parameters:
Return type:

lenskit.data.ItemList