lenskit.pipeline.Trainable#
- class lenskit.pipeline.Trainable(*args, **kwargs)#
Bases:
Protocol
Interface for components that can learn parameters from training data. It supports trainingand checking if a component has already been trained. Trained components need to be picklable.
Note
Trainable components must also implement
__call__
.Note
A future LensKit version will add support for extracting model parameters a la Pytorch’s
state_dict
, but this capability was not ready for 2025.1.- __init__(*args, **kwargs)#
Methods
__init__
(*args, **kwargs)train
(data)Train the pipeline component to learn its parameters from a training dataset.
Attributes
Check if this model has already been trained.