vak.models.decorator.model#
- vak.models.decorator.model(family: Type[Model])[source]#
Decorator that makes a model class, given a definition of the model, and another class that represents a family of models that the new model belongs to.
Returns a newly-created subclass of the class representing the family of models. The subclass can then be instantiated and have all model methods.
- Parameters:
definition (type) – The definition of the new model that will be made. A class with all the class variables required by
vak.models.definition.validate()
. See docstring of that function for specification.family (subclass of vak.models.Model) – The class representing the family of models that the new model will belong to. E.g.,
vak.models.FrameClassificationModel
.
- Returns:
model – A sub-class of
model_family
, with attributedefinition
, that will be used when making new instances of the model.- Return type: