REST Resource: projects.locations.models

Resource: Model

API proto representing a trained machine learning model.

JSON representation
{
  "name": string,
  "displayName": string,
  "datasetId": string,
  "createTime": string,
  "updateTime": string,
  "deploymentState": enum (DeploymentState),
  "etag": string,
  "labels": {
    string: string,
    ...
  },

  // Union field model_metadata can be only one of the following:
  "translationModelMetadata": {
    object (TranslationModelMetadata)
  },
  "imageClassificationModelMetadata": {
    object (ImageClassificationModelMetadata)
  },
  "textClassificationModelMetadata": {
    object (TextClassificationModelMetadata)
  },
  "imageObjectDetectionModelMetadata": {
    object (ImageObjectDetectionModelMetadata)
  },
  "textExtractionModelMetadata": {
    object (TextExtractionModelMetadata)
  },
  "textSentimentModelMetadata": {
    object (TextSentimentModelMetadata)
  }
  // End of list of possible types for union field model_metadata.
}
Fields
name

string

Output only. Resource name of the model. Format: projects/{project_id}/locations/{locationId}/models/{modelId}

displayName

string

Required. The name of the model to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9. It must start with a letter.

datasetId

string

Required. The resource ID of the dataset used to create the model. The dataset must come from the same ancestor project and location.

createTime

string (Timestamp format)

Output only. Timestamp when the model training finished and can be used for prediction.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. Timestamp when this model was last updated.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

deploymentState

enum (DeploymentState)

Output only. Deployment state of the model. A model can only serve prediction requests after it gets deployed.

etag

string

Used to perform a consistent read-modify-write updates. If not set, a blind "overwrite" update happens.

labels

map (key: string, value: string)

Optional. The labels with user-defined metadata to organize your model.

Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.

See https://goo.gl/xmQnxf for more information on and examples of labels.

Union field model_metadata. Required. The model metadata that is specific to the problem type. Must match the metadata type of the dataset used to train the model. model_metadata can be only one of the following:
translationModelMetadata

object (TranslationModelMetadata)

Metadata for translation models.

imageClassificationModelMetadata

object (ImageClassificationModelMetadata)

Metadata for image classification models.

textClassificationModelMetadata

object (TextClassificationModelMetadata)

Metadata for text classification models.

imageObjectDetectionModelMetadata

object (ImageObjectDetectionModelMetadata)

Metadata for image object detection models.

textExtractionModelMetadata

object (TextExtractionModelMetadata)

Metadata for text extraction models.

textSentimentModelMetadata

object (TextSentimentModelMetadata)

Metadata for text sentiment models.

TranslationModelMetadata

Model metadata that is specific to translation.

JSON representation
{
  "baseModel": string,
  "sourceLanguageCode": string,
  "targetLanguageCode": string
}
Fields
baseModel

string

The resource name of the model to use as a baseline to train the custom model. If unset, we use the default base model provided by Google Translate. Format: projects/{project_id}/locations/{locationId}/models/{modelId}

sourceLanguageCode

string

Output only. Inferred from the dataset. The source language (The BCP-47 language code) that is used for training.

targetLanguageCode

string

Output only. The target language (The BCP-47 language code) that is used for training.

ImageClassificationModelMetadata

Model metadata for image classification.

JSON representation
{
  "baseModelId": string,
  "trainBudgetMilliNodeHours": string,
  "trainCostMilliNodeHours": string,
  "stopReason": string,
  "modelType": string,
  "nodeQps": number,
  "nodeCount": string
}
Fields
baseModelId

string

Optional. The ID of the base model. If it is specified, the new model will be created based on the base model. Otherwise, the new model will be created from scratch. The base model must be in the same project and location as the new model to create, and have the same modelType.

trainBudgetMilliNodeHours

string (int64 format)

The train budget of creating this model, expressed in milli node hours i.e. 1,000 value in this field means 1 node hour. The actual trainCost will be equal or less than this value. If further model training ceases to provide any improvements, it will stop without using full budget and the stopReason will be MODEL_CONVERGED. Note, node_hour = actual_hour * number_of_nodes_invovled. For model type cloud(default), the train budget must be between 8,000 and 800,000 milli node hours, inclusive. The default value is 192, 000 which represents one day in wall time. For model type mobile-low-latency-1, mobile-versatile-1, mobile-high-accuracy-1, mobile-core-ml-low-latency-1, mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1, the train budget must be between 1,000 and 100,000 milli node hours, inclusive. The default value is 24, 000 which represents one day in wall time.

trainCostMilliNodeHours

string (int64 format)

Output only. The actual train cost of creating this model, expressed in milli node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed to not exceed the train budget.

stopReason

string

Output only. The reason that this create model operation stopped, e.g. BUDGET_REACHED, MODEL_CONVERGED.

modelType

string

Optional. Type of the model. The available values are: * cloud - Model to be used via prediction calls to AutoML API. This is the default value. * mobile-low-latency-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile or edge device with TensorFlow afterwards. Expected to have low latency, but may have lower prediction quality than other models. * mobile-versatile-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile or edge device with TensorFlow afterwards. * mobile-high-accuracy-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile or edge device with TensorFlow afterwards. Expected to have a higher latency, but should also have a higher prediction quality than other models. * mobile-core-ml-low-latency-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile device with Core ML afterwards. Expected to have low latency, but may have lower prediction quality than other models. * mobile-core-ml-versatile-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile device with Core ML afterwards. * mobile-core-ml-high-accuracy-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile device with Core ML afterwards. Expected to have a higher latency, but should also have a higher prediction quality than other models.

nodeQps

number

Output only. An approximate number of online prediction QPS that can be supported by this model per each node on which it is deployed.

nodeCount

string (int64 format)

Output only. The number of nodes this model is deployed on. A node is an abstraction of a machine resource, which can handle online prediction QPS as given in the nodeQps field.

TextClassificationModelMetadata

Model metadata that is specific to text classification.

JSON representation
{
  "classificationType": enum (ClassificationType)
}
Fields
classificationType

enum (ClassificationType)

Output only. Classification type of the dataset used to train this model.

ImageObjectDetectionModelMetadata

Model metadata specific to image object detection.

JSON representation
{
  "modelType": string,
  "nodeCount": string,
  "nodeQps": number,
  "stopReason": string,
  "trainBudgetMilliNodeHours": string,
  "trainCostMilliNodeHours": string
}
Fields
modelType

string

Optional. Type of the model. The available values are: * cloud-high-accuracy-1 - (default) A model to be used via prediction calls to AutoML API. Expected to have a higher latency, but should also have a higher prediction quality than other models. * cloud-low-latency-1 - A model to be used via prediction calls to AutoML API. Expected to have low latency, but may have lower prediction quality than other models. * mobile-low-latency-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile or edge device with TensorFlow afterwards. Expected to have low latency, but may have lower prediction quality than other models. * mobile-versatile-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile or edge device with TensorFlow afterwards. * mobile-high-accuracy-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile or edge device with TensorFlow afterwards. Expected to have a higher latency, but should also have a higher prediction quality than other models.

nodeCount

string (int64 format)

Output only. The number of nodes this model is deployed on. A node is an abstraction of a machine resource, which can handle online prediction QPS as given in the qps_per_node field.

nodeQps

number

Output only. An approximate number of online prediction QPS that can be supported by this model per each node on which it is deployed.

stopReason

string

Output only. The reason that this create model operation stopped, e.g. BUDGET_REACHED, MODEL_CONVERGED.

trainBudgetMilliNodeHours

string (int64 format)

The train budget of creating this model, expressed in milli node hours i.e. 1,000 value in this field means 1 node hour. The actual trainCost will be equal or less than this value. If further model training ceases to provide any improvements, it will stop without using full budget and the stopReason will be MODEL_CONVERGED. Note, node_hour = actual_hour * number_of_nodes_invovled. For model type cloud-high-accuracy-1(default) and cloud-low-latency-1, the train budget must be between 20,000 and 900,000 milli node hours, inclusive. The default value is 216, 000 which represents one day in wall time. For model type mobile-low-latency-1, mobile-versatile-1, mobile-high-accuracy-1, mobile-core-ml-low-latency-1, mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1, the train budget must be between 1,000 and 100,000 milli node hours, inclusive. The default value is 24, 000 which represents one day in wall time.

trainCostMilliNodeHours

string (int64 format)

Output only. The actual train cost of creating this model, expressed in milli node hours, i.e. 1,000 value in this field means 1 node hour. Guaranteed to not exceed the train budget.

TextExtractionModelMetadata

Model metadata that is specific to text extraction.

TextSentimentModelMetadata

Model metadata that is specific to text sentiment.

DeploymentState

Deployment state of the model.

Enums
DEPLOYMENT_STATE_UNSPECIFIED Should not be used, an un-set enum has this value by default.
DEPLOYED Model is deployed.
UNDEPLOYED Model is not deployed.

Methods

batchPredict

Perform a batch prediction.

create

Creates a model.

delete

Deletes a model.

deploy

Deploys a model.

export

Exports a trained, "export-able", model to a user specified Google Cloud Storage location.

get

Gets a model.

getIamPolicy

Gets the access control policy for a resource.

list

Lists models.

patch

Updates a model.

predict

Perform an online prediction.

setIamPolicy

Sets the access control policy on the specified resource.

undeploy

Undeploys a model.