Skip to content

Model Representation

ModelRepresentation

Represents the metadata of a Vectice model.

A Model Representation shows information about a specific model from the Vectice app. It makes it easier to get and read this information through the API. This includes high level information about the various versions of the model.

Hint

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

Attributes:

Name Type Description
id str

The unique identifier of the model.

project_id str

The identifier of the project to which the model belongs.

name str

The name of the model.

description str

The description of the model.

type str

The type of the model

total_number_of_versions int

The total number of versions belonging to this model.

versions_status Dict[str, Any]

Aggregated information about the statuses of model versions within the model (e.g., number of versions in production, staging...).

asdict

asdict()

Transform the ModelRepresentation into a organised dictionary.

Returns:

Type Description
Dict[str, Any]

The object represented as a dictionary

list_versions

list_versions(
    number_of_items=DEFAULT_NUMBER_OF_ITEMS,
    as_dataframe=False,
)

Retrieve the model versions list linked to the model. (Maximum of 100 versions).

Parameters:

Name Type Description Default
number_of_items int

The number of versions to retrieve. Defaults to 30.

DEFAULT_NUMBER_OF_ITEMS
as_dataframe bool

If set to True, return type will be a pandas DataFrame for easier manipulation (requires pandas to be installed). If set to False, returns all model versions as a list of ModelVersionRepresentation.

False

Returns:

Type Description
List[ModelVersionRepresentation] | DataFrame

The model versions list as either a list of ModelVersionRepresentation or a pandas DataFrame.

versions_list

versions_list(number_of_versions=30, as_dataframe=True)

Retrieve the model versions list linked to the model. (Maximum of 100 versions).

Parameters:

Name Type Description Default
number_of_versions int

The number of versions to retrieve. Defaults to 30.

30
as_dataframe bool

If set to True, return type will be a pandas DataFrame for easier manipulation (requires pandas to be installed). If set to False, returns all model versions as a list of dictionaries.

True

Returns:

Type Description
List[Dict[str, Any]] | DataFrame

The model versions list as either a list of dictionaries or a pandas DataFrame.