EvaluatorOperations Class

EvaluatorOperations.

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

Inheritance
azure.ai.ml._scope_dependent_operations._ScopeDependentOperations
EvaluatorOperations

Constructor

EvaluatorOperations(operation_scope: OperationScope, operation_config: OperationConfig, service_client: AzureMachineLearningWorkspaces | AzureMachineLearningWorkspaces, datastore_operations: DatastoreOperations, all_operations: OperationsContainer | None = None, **kwargs)

Parameters

Name Description
operation_scope
Required
<xref:azure.ai.ml._scope_dependent_operations.OperationScope>

Scope variables for the operations classes of an MLClient object.

operation_config
Required
<xref:azure.ai.ml._scope_dependent_operations.OperationConfig>

Common configuration for operations classes of an MLClient object.

service_client
Required
Union[ <xref:azure.ai.ml._restclient.v2023_04_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces>, <xref:azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces. AzureMachineLearningWorkspaces>]

Service client to allow end users to operate on Azure Machine Learning Workspace resources (ServiceClient082023Preview or ServiceClient102021Dataplane).

datastore_operations
Required

Represents a client for performing operations on Datastores.

all_operations
<xref:azure.ai.ml._scope_dependent_operations.OperationsContainer>

All operations classes of an MLClient object.

Default value: None
kwargs
Required

A dictionary of additional configuration parameters.

Methods

create_or_update

Returns created or updated model asset.

download

Download files related to a model.

get

Returns information about the specified model asset.

list

List all model assets in workspace.

create_or_update

Returns created or updated model asset.

create_or_update(model: Model | WorkspaceAssetReference, **kwargs: Any) -> Model

Parameters

Name Description
model
Required

Model asset object.

Returns

Type Description

Model asset object.

Exceptions

Type Description

Raised when the Model artifact path is already linked to another asset

Raised if Model cannot be successfully validated. Details will be provided in the error message.

Raised if local path provided points to an empty directory.

download

Download files related to a model.

download(name: str, version: str, download_path: PathLike | str = '.', **kwargs: Any) -> None

Parameters

Name Description
name
Required
str

Name of the model.

version
Required
str

Version of the model.

download_path
Required
Union[<xref:PathLike>, str]

Local path as download destination, defaults to current working directory of the current user. Contents will be overwritten.

Exceptions

Type Description
ResourceNotFoundError

if can't find a model matching provided name.

get

Returns information about the specified model asset.

get(name: str, *, version: str | None = None, label: str | None = None, **kwargs) -> Model

Parameters

Name Description
name
Required
str

Name of the model.

Keyword-Only Parameters

Name Description
version
str

Version of the model.

label
str

Label of the model. (mutually exclusive with version)

Returns

Type Description

Model asset object.

Exceptions

Type Description

Raised if Model cannot be successfully validated. Details will be provided in the error message.

list

List all model assets in workspace.

list(name: str, stage: str | None = None, *, list_view_type: ListViewType = ListViewType.ACTIVE_ONLY, **kwargs: Any) -> Iterable[Model]

Parameters

Name Description
name
Required
str

Name of the model.

stage
Required

The Model stage

Keyword-Only Parameters

Name Description
list_view_type

View type for including/excluding (for example) archived models. Defaults to <xref:ListViewType.ACTIVE_ONLY>.

Returns

Type Description

An iterator like instance of Model objects

Exceptions

Type Description

Raised when the Model artifact path is already linked to another asset

Raised if Model cannot be successfully validated. Details will be provided in the error message.

Raised if local path provided points to an empty directory.