Registered Model

Note

New in version 0.15.0.

class verta._registry.model.RegisteredModel

Object representing a registered model.

There should not be a need to instantiate this class directly; please use Client.get_or_create_registered_model()

Variables:
  • id (int) – ID of this Registered Model.
  • name (str) – Name of this Registered Model.
  • versions (iterable of RegisteredModelVersion) – Versions of this RegisteredModel.
get_or_create_version(name=None, desc=None, labels=None, attrs=None, id=None, time_created=None)

Gets or creates a Model Version.

If an accessible Model Version with name name does not already exist under this Registered Model, it will be created and initialized with specified metadata parameters. If such a Model Version does already exist, it will be retrieved.

Parameters:
  • name (str, optional) – Name of the Model Version. If no name is provided, one will be generated.
  • desc (str, optional) – Description of the Model Version.
  • labels (list of str, optional) – Labels of the Model Version.
  • attrs (dict of str to {None, bool, float, int, str}, optional) – Attributes of the Model Version.
  • id (str, optional) – ID of the Model Version. This parameter cannot be provided alongside name, and other parameters will be ignored.
Returns:

RegisteredModelVersion

Raises:

ValueError – If name and id are both passed in.

set_version(*args, **kwargs)

Alias for RegisteredModel.get_or_create_version().

create_version(name=None, desc=None, labels=None, attrs=None, time_created=None)

Creates a model registry entry.

Parameters:
  • name (str, optional) – Name of the Model Version. If no name is provided, one will be generated.
  • desc (str, optional) – Description of the Model Version.
  • labels (list of str, optional) – Labels of the Model Version.
  • attrs (dict of str to {None, bool, float, int, str}, optional) – Attributes of the Model Version.
Returns:

RegisteredModelVersion

create_version_from_run(run_id, name=None)

Creates a model registry entry based on an Experiment Run.

Parameters:
  • run_id (str) –
  • name (str, optional) –
Returns:

RegisteredModelVersion

get_version(name=None, id=None)

Gets a Model Version of this Registered Model by name or id

Parameters:
  • name (str, optional) – Name of the Model Version. If no name is provided, one will be generated.
  • id (str, optional) – ID of the Model Version. This parameter cannot be provided alongside name, and other parameters will be ignored.
Returns:

RegisteredModelVersion

add_labels(labels)

Adds multiple labels to this Registered Model.

Parameters:labels (list of str) – Labels to add.
add_label(label)

Adds a label to this Registered Model.

Parameters:label (str) – Label to add.
del_label(label)

Deletes a label from this Registered Model.

Parameters:label (str) – Label to delete.
get_labels()

Gets all labels of this Registered Model.

Returns:labels (list of str) – List of all labels of this Registered Model.
delete()

Deletes this registered model.