lenskit.training.Trainable#

class lenskit.training.Trainable#

Bases: Protocol

Interface for components and objects that can learn parameters from training data. It supports training and checking if a component has already been trained. This protocol only captures the concept of trainability; most trainable components should have other properties and behaviors as well:

  • They are usually components (Component), with an appropriate __call__ method.

  • They should be pickleable.

Stability:
Full (see Stability Levels).
abstractmethod is_trained()#

Query if this component has already been trained.

Return type:

bool

abstractmethod train(data, options)#

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

Parameters:
Return type:

None