ml
v1
|
Represents a version of the model. More...
Properties | |
virtual GoogleCloudMlV1AcceleratorConfig | AcceleratorConfig [get, set] |
Optional. Accelerator config for using GPUs for online prediction (beta). Only specify this field if you have specified a Compute Engine (N1) machine type in the machineType field. Learn more about using GPUs for online prediction. More... | |
virtual GoogleCloudMlV1AutoScaling | AutoScaling [get, set] |
Automatically scale the number of nodes used to serve the model in response to increases and decreases in traffic. Care should be taken to ramp up traffic according to the model's ability to scale or you will start seeing increases in latency and 429 response codes. More... | |
virtual object | CreateTime [get, set] |
Output only. The time the version was created. More... | |
virtual string | DeploymentUri [get, set] |
Required. The Cloud Storage location of the trained model used to create the version. See the guide to model deployment for more information. More... | |
virtual string | Description [get, set] |
Optional. The description specified for the version when it was created. More... | |
virtual string | ErrorMessage [get, set] |
Output only. The details of a failure or a cancellation. More... | |
virtual string | ETag [get, set] |
etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a model from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform model updates in order to avoid race conditions: An etag is returned in the response to GetVersion , and systems are expected to put that etag in the request to UpdateVersion to ensure that their change will be applied to the model as intended. More... | |
virtual GoogleCloudMlV1ExplanationConfig | ExplanationConfig [get, set] |
Optional. Configures explainability features on the model's version. Some explanation features require additional metadata to be loaded as part of the model payload. More... | |
virtual string | Framework [get, set] |
Optional. The machine learning framework AI Platform uses to train this version of the model. Valid values are TENSORFLOW , SCIKIT_LEARN , XGBOOST . If you do not specify a framework, AI Platform will analyze files in the deployment_uri to determine a framework. If you choose SCIKIT_LEARN or XGBOOST , you must also set the runtime version of the model to 1.4 or greater. More... | |
virtual System.Nullable< bool > | IsDefault [get, set] |
Output only. If true, this version will be used to handle prediction requests that do not specify a version. More... | |
virtual System.Collections.Generic.IDictionary< string, string > | Labels [get, set] |
Optional. One or more labels that you can add, to organize your model versions. Each label is a key-value pair, where both the key and the value are arbitrary strings that you supply. For more information, see the documentation on using labels. More... | |
virtual object | LastUseTime [get, set] |
Output only. The time the version was last used for prediction. More... | |
virtual string | MachineType [get, set] |
Optional. The type of machine on which to serve the model. Currently only applies to online prediction service. If this field is not specified, it defaults to mls1-c1-m2 . More... | |
virtual GoogleCloudMlV1ManualScaling | ManualScaling [get, set] |
Manually select the number of nodes to use for serving the model. You should generally use auto_scaling with an appropriate min_nodes instead, but this option is available if you want more predictable billing. Beware that latency and error rates will increase if the traffic exceeds that capability of the system to serve it based on the selected number of nodes. More... | |
virtual string | Name [get, set] |
Required. The name specified for the version when it was created. More... | |
virtual System.Collections.Generic.IList< string > | PackageUris [get, set] |
Optional. Cloud Storage paths (gs://… ) of packages for custom prediction routines or scikit-learn pipelines with custom code. More... | |
virtual string | PredictionClass [get, set] |
Optional. The fully qualified name (module_name.class_name) of a class that implements the Predictor interface described in this reference field. The module containing this class should be included in a package provided to the packageUris field. More... | |
virtual string | PythonVersion [get, set] |
Required. The version of Python used in prediction. More... | |
virtual GoogleCloudMlV1RequestLoggingConfig | RequestLoggingConfig [get, set] |
Optional. Only specify this field in a projects.models.versions.patch request. Specifying it in a projects.models.versions.create request has no effect. More... | |
virtual string | RuntimeVersion [get, set] |
Required. The AI Platform runtime version to use for this deployment. More... | |
virtual string | ServiceAccount [get, set] |
Optional. Specifies the service account for resource access control. More... | |
virtual string | State [get, set] |
Output only. The state of a version. More... | |
Properties inherited from Google::Apis::Requests::IDirectResponseSchema | |
string | ETag |
Represents a version of the model.
Each version is a trained model deployed in the cloud, ready to handle prediction requests. A model can have multiple versions. You can get information about all of the versions of a given model by calling projects.models.versions.list.
|
getset |
Optional. Accelerator config for using GPUs for online prediction (beta). Only specify this field if you have specified a Compute Engine (N1) machine type in the machineType
field. Learn more about using GPUs for online prediction.
|
getset |
Automatically scale the number of nodes used to serve the model in response to increases and decreases in traffic. Care should be taken to ramp up traffic according to the model's ability to scale or you will start seeing increases in latency and 429 response codes.
Note that you cannot use AutoScaling if your version uses GPUs. Instead, you must use specify manual_scaling
.
|
getset |
Output only. The time the version was created.
|
getset |
Required. The Cloud Storage location of the trained model used to create the version. See the guide to model deployment for more information.
When passing Version to projects.models.versions.create the model service uses the specified location as the source of the model. Once deployed, the model version is hosted by the prediction service, so this location is useful only as a historical record. The total number of model files can't exceed 1000.
|
getset |
Optional. The description specified for the version when it was created.
|
getset |
Output only. The details of a failure or a cancellation.
|
getset |
etag
is used for optimistic concurrency control as a way to help prevent simultaneous updates of a model from overwriting each other. It is strongly suggested that systems make use of the etag
in the read-modify-write cycle to perform model updates in order to avoid race conditions: An etag
is returned in the response to GetVersion
, and systems are expected to put that etag in the request to UpdateVersion
to ensure that their change will be applied to the model as intended.
|
getset |
Optional. Configures explainability features on the model's version. Some explanation features require additional metadata to be loaded as part of the model payload.
|
getset |
Optional. The machine learning framework AI Platform uses to train this version of the model. Valid values are TENSORFLOW
, SCIKIT_LEARN
, XGBOOST
. If you do not specify a framework, AI Platform will analyze files in the deployment_uri to determine a framework. If you choose SCIKIT_LEARN
or XGBOOST
, you must also set the runtime version of the model to 1.4 or greater.
Do not specify a framework if you're deploying a custom prediction routine.
If you specify a Compute Engine (N1) machine type in the machineType
field, you must specify TENSORFLOW
for the framework.
|
getset |
Output only. If true, this version will be used to handle prediction requests that do not specify a version.
You can change the default version by calling projects.methods.versions.setDefault.
|
getset |
Optional. One or more labels that you can add, to organize your model versions. Each label is a key-value pair, where both the key and the value are arbitrary strings that you supply. For more information, see the documentation on using labels.
|
getset |
Output only. The time the version was last used for prediction.
|
getset |
Optional. The type of machine on which to serve the model. Currently only applies to online prediction service. If this field is not specified, it defaults to mls1-c1-m2
.
Online prediction supports the following machine types:
mls1-c1-m2
* mls1-c4-m2
* n1-standard-2
* n1-standard-4
* n1-standard-8
* n1-standard-16
* n1-standard-32
* n1-highmem-2
* n1-highmem-4
* n1-highmem-8
* n1-highmem-16
* n1-highmem-32
* n1-highcpu-2
* n1-highcpu-4
* n1-highcpu-8
* n1-highcpu-16
* n1-highcpu-32
mls1-c1-m2
is generally available. All other machine types are available in beta. Learn more about the differences between machine types.
|
getset |
Manually select the number of nodes to use for serving the model. You should generally use auto_scaling
with an appropriate min_nodes
instead, but this option is available if you want more predictable billing. Beware that latency and error rates will increase if the traffic exceeds that capability of the system to serve it based on the selected number of nodes.
|
getset |
Required. The name specified for the version when it was created.
The version name must be unique within the model it is created in.
|
getset |
Optional. Cloud Storage paths (gs://…
) of packages for custom prediction routines or scikit-learn pipelines with custom code.
For a custom prediction routine, one of these packages must contain your Predictor class (see predictionClass
). Additionally, include any dependencies used by your Predictor or scikit-learn pipeline uses that are not already included in your selected runtime version.
If you specify this field, you must also set runtimeVersion
to 1.4 or greater.
|
getset |
Optional. The fully qualified name (module_name.class_name) of a class that implements the Predictor interface described in this reference field. The module containing this class should be included in a package provided to the packageUris
field.
Specify this field if and only if you are deploying a custom prediction routine (beta). If you specify this field, you must set runtimeVersion
to 1.4 or greater and you must set machineType
to a legacy (MLS1) machine type.
The following code sample provides the Predictor interface:
class Predictor(object): Interface for constructing custom predictors.
def predict(self, instances, **kwargs): Performs custom prediction.
Instances are the decoded values from the request. They have already been deserialized from JSON.
Args: instances: A list of prediction input instances. **kwargs: A dictionary of keyword args provided as additional fields on the predict request body.
Returns: A list of outputs containing the prediction results. This list must be JSON serializable.
raise NotImplementedError()
def from_path(cls, model_dir): Creates an instance of Predictor using the given path.
Loading of the predictor should be done in this method.
Args: model_dir: The local directory that contains the exported model file along with any additional files uploaded when creating the version resource.
Returns: An instance implementing this Predictor class.
raise NotImplementedError()
Learn more about the Predictor interface and custom prediction routines.
|
getset |
Required. The version of Python used in prediction.
The following Python versions are available:
runtime_version
is set to '1.15' or later. * Python '3.5' is available when runtime_version
is set to a version from '1.4' to '1.14'. * Python '2.7' is available when runtime_version
is set to '1.15' or earlier.Read more about the Python versions available for each runtime version.
|
getset |
Optional. Only specify this field in a projects.models.versions.patch request. Specifying it in a projects.models.versions.create request has no effect.
Configures the request-response pair logging on predictions from this Version.
|
getset |
Required. The AI Platform runtime version to use for this deployment.
For more information, see the runtime version list and how to manage runtime versions.
|
getset |
Optional. Specifies the service account for resource access control.
|
getset |
Output only. The state of a version.