lenskit.knn.ease#

EASE scoring model.

Classes#

EASEConfig

Configuration for EASEScorer.

EASEScorer

Embarrassingly shallow autoencoder

Module Contents#

class lenskit.knn.ease.EASEConfig#

Bases: pydantic.BaseModel

Configuration for EASEScorer.

regularization: pydantic.PositiveFloat = 1#

Regularization term for EASE.

class lenskit.knn.ease.EASEScorer(config=None, **kwargs)#

Bases: lenskit.pipeline.Component[lenskit.data.ItemList], lenskit.training.Trainable

Embarrassingly shallow autoencoder [Ste19].

In addition to its configuation, this component also uses a training environment variable LK_EASE_SOLVER.

Parameters:
  • config (object | None)

  • kwargs (Any)

LK_EASE_SOLVER#

Specify the solver to use to invert the Gram-matrix for EASE. Can be either "torch" (works on both CPU and CUDA, and is faster on CPU than SciPy) or "scipy" (uses LAPACK, and may take less memory).

The default behavior is to first try to allocate enough memory to train with PyTorch, and to fall back to SciPy with in-place solving if the Torch allocation fails.

Note

This component requires SciPy 1.17 or later.

config: EASEConfig#

EASE configuration.

items: lenskit.data.Vocabulary#

Items known at training time.

weights: lenskit.data.types.NPMatrix[numpy.float32]#

Item interpolation weight matrix.

is_trained()#

Query if this component has already been trained.

train(data, options=None)#

Train the model to learn its parameters from a training dataset.

Parameters:
__call__(query, items)#

Run the pipeline’s operation and produce a result. This is the key method for components to implement.

Parameters:
Return type:

lenskit.data.ItemList

Exported Aliases#

class lenskit.knn.ease.Dataset#

Re-exported alias for lenskit.data.Dataset.

class lenskit.knn.ease.ItemList#

Re-exported alias for lenskit.data.ItemList.

class lenskit.knn.ease.RecQuery#

Re-exported alias for lenskit.data.RecQuery.

class lenskit.knn.ease.Vocabulary#

Re-exported alias for lenskit.data.Vocabulary.

lenskit.knn.ease.NPMatrix#

Re-exported alias for lenskit.data.types.NPMatrix.

class lenskit.knn.ease.Stopwatch#

Re-exported alias for lenskit.logging.Stopwatch.

lenskit.knn.ease.get_logger()#

Re-exported alias for lenskit.logging.get_logger().

lenskit.knn.ease.ensure_parallel_init()#

Re-exported alias for lenskit.parallel.ensure_parallel_init().

class lenskit.knn.ease.Component#

Re-exported alias for lenskit.pipeline.Component.

class lenskit.knn.ease.Trainable#

Re-exported alias for lenskit.training.Trainable.

class lenskit.knn.ease.TrainingOptions#

Re-exported alias for lenskit.training.TrainingOptions.