myogestic.utils.config.Registry.register_model#

Registry.register_model(name, model_class, is_classifier, save_function, load_function, train_function, predict_function, changeable_parameters=None, unchangeable_parameters=None)[source]#

Register a model in the registry.

The model name must be unique.

Parameters:
  • name (str) – The name of the model.

  • model_class (type) – The class of the model.

  • is_classifier (bool) – Whether the model is a classifier.

  • save_function (callable) – The function to save the model.

  • load_function (callable) – The function to load the model.

  • train_function (callable) – The function to train the model.

  • predict_function (callable) – The function to make predictions with the model.

  • changeable_parameters (dict of str to ChangeableParameter, optional) – A dictionary of changeable parameters for the model. Default is None.

  • unchangeable_parameters (dict of str to UnchangeableParameter, optional) – A dictionary of unchangeable parameters for the model. Default is None.

Raises:

ValueError – If the model is already registered.