lenskit.knn.ease#

EASE scoring model.

Classes

EASEConfig(*[, regularization])

Configuration for EASEScorer.

EASEScorer([config])

Embarrassingly shallow autoencoder [Ste19].

class lenskit.knn.ease.EASEConfig(*, regularization=1)#

Bases: BaseModel

Configuration for EASEScorer.

Parameters:

regularization (Annotated[float, Gt(gt=0)])

regularization: Annotated[float, Gt(gt=0)]#

Regularization term for EASE.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

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

Bases: Component[ItemList, …], Trainable

Embarrassingly shallow autoencoder [Ste19].

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

Parameters:
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.

items: Vocabulary#

Items known at training time.

weights: ndarray[tuple[int, int], dtype[float32]]#

Item interpolation weight matrix.

train(data, options=None)#

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

Parameters: