lenskit.knn.ease#
EASE scoring model.
Classes#
Configuration for |
|
Embarrassingly shallow autoencoder |
Module Contents#
- class lenskit.knn.ease.EASEConfig#
Bases:
pydantic.BaseModelConfiguration 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.TrainableEmbarrassingly 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:
data (lenskit.data.Dataset) – The training dataset.
options (lenskit.training.TrainingOptions | None) – The training options.
- __call__(query, items)#
Run the pipeline’s operation and produce a result. This is the key method for components to implement.
- Parameters:
query (lenskit.data.RecQuery)
items (lenskit.data.ItemList)
- Return type:
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.