Updated on 2024-03-21 GMT+08:00

Querying a Built-in Algorithm

Sample Code

In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.

1
2
3
4
5
from modelarts.session import Session
from modelarts.estimator import Estimator
session = Session()
algo_info = Estimator.get_built_in_algorithms(modelarts_session=session)
print(algo_info)

Parameters

Table 1 get_built_in_algorithms request parameters

Parameter

Mandatory

Type

Description

modelarts_session

Yes

Object

Session object. For details about the initialization method, see Session Authentication.

Table 2 get_built_in_algorithms response parameters

Parameter

Type

Description

error_msg

String

Error message when the API call fails.

This parameter is not included when the API call succeeds.

error_code

String

Error code when the API fails to be called. For details, see Error Codes.

This parameter is not included when the API call succeeds.

model_total_count

Integer

Number of models

models

JSON Array

Parameter list of a model

is_success

Boolean

Whether the API call succeeds

Table 3 models parameters

Parameter

Type

Description

model_id

Integer

Model ID

model_name

String

Model name

model_usage

Integer

Model usage. The options are as follows:

  • 1: image classification
  • 2: object class and location
  • 3: image semantic segmentation
  • 4: natural language processing

model_precision

String

Model precision

model_size

Long

Model size, in bytes

model_train_dataset

String

Model training dataset

model_dataset_format

String

Dataset format required by a model

model_description_url

String

URL of the model description

parameter

JSON Array

Running parameters of a model. It is a collection of label-value pairs. This parameter is a container environment variable when a job uses a custom image. For details, see the sample request.

create_time

Long

Time when a model is created

engine_id

Long

Engine ID of a model

engine_name

String

Engine name of a model

engine_version

String

Engine version of a model