Skip to content

Model Version Representation

ModelVersionRepresentation

Represents the metadata of a Vectice model version.

A Model Version Representation shows information about a specific version of a model from the Vectice app. It makes it easier to get and read this information through the API.

Hint

A model version ID starts with 'MDV-XXX'. Retrieve the ID in the Vectice App, then use the ID with the following methods to get the model version: connect.model_version('MDV-XXX') or connect.browse('MDV-XXX') (see Connection page).

Attributes:

Name Type Description
id str

The unique identifier of the model version.

project_id str

The identifier of the project to which the model version belongs.

name str

The name of the model version. For model versions it corresponds to the version number.

status str

The status of the model version (EXPERIMENTATION, STAGING, PRODUCTION, or RETIRED).

description str

The description of the model version.

technique str

The technique used by the model version.

library str

The library used by the model version.

iteration_origin str | None

The iteration in which this model version was created.

phase_origin str | None

The phase in which this model version was created.

metrics List[Dict[str, Any]]

The metrics associated with the model version.

properties List[Dict[str, Any]]

The properties associated with the model version.

model_representation ModelRepresentation

Holds informations about the source model linked to the model version, where all versions are grouped together.

asdict

asdict()

Transform the ModelVersionRepresentation into a organised dictionary.

Returns:

Type Description
Dict[str, Any]

The object represented as a dictionary

download_attachments

download_attachments(attachments=None, output_dir=None)

Downloads attachments of this version.

Parameters:

Name Type Description Default
attachments list[str] | str | None

Specific attachments to download, if None then all the version attachments will be downloaded.

None
output_dir str | None

Destination for the attachments to be downloaded to. If None then attachments will be downloaded to the current directory.

None

Returns:

Type Description
None

None.

get_table

get_table(table)

Extracts the Vectice table in attachment of the model version representation into a DataFrame for better readability.

Returns:

Type Description
DataFrame

A pandas DataFrame representing the table of the model version.

list_attachments

list_attachments()

Lists all the attachments (tables, files, pickle...) of the ModelVersionRepresentation.

Returns:

Type Description
list[Attachment]

The attachments list.

metrics_as_dataframe

metrics_as_dataframe()

Transforms the metrics of the ModelVersionRepresentation into a DataFrame for better readability.

Returns:

Type Description
DataFrame

A pandas DataFrame containing the metrics of the model version.

properties_as_dataframe

properties_as_dataframe()

Transforms the properties of the ModelVersionRepresentation into a DataFrame for better readability.

Returns:

Type Description
DataFrame

A pandas DataFrame containing the properties of the model version.

update

update(
    status=None,
    metrics=None,
    properties=None,
    attachments=None,
)

Update the Model Version from the API.

Parameters:

Name Type Description Default
status str | None

The new status of the model. Accepted values are EXPERIMENTATION, STAGING, PRODUCTION and RETIRED.

None
properties dict[str, str | int] | list[Property] | Property | None

The new properties of the model.

None
metrics dict[str, int | float] | list[Metric] | Metric | None

The new metrics of the model.

None
attachments TAttachment | None

The new attachments of the model.

None

Returns:

Type Description
None

None