lenskit.training.UsesTrainer#
- class lenskit.training.UsesTrainer(config=None, **kwargs)#
Bases:
lenskit.pipeline.components.Component,abc.ABC,TrainableBase class for models that implement
Trainablevia aModelTrainer.The component’s configuration must have an
epochsattribute defining the number of epochs to train.- Stability:
- Full (see Stability Levels).
- Parameters:
config (object | None)
kwargs (Any)
- property expected_training_epochs: int | None#
Get the number of training epochs expected to run. The default implementation looks for an
epochsattribute on the configuration object (self.config).- Return type:
int | None
- is_trained()#
Query if this component has already been trained.
- train(data, options=TrainingOptions())#
Implementation of
Trainable.train()that uses the model trainer.- Parameters:
data (lenskit.data.Dataset)
options (TrainingOptions)
- Return type:
None
- abstractmethod create_trainer(data, options)#
Create a model trainer to train this model.
- Parameters:
data (lenskit.data.Dataset)
options (TrainingOptions)
- Return type: