Class: Google::Apis::MlV1::GoogleCloudMlV1Model

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/ml_v1/classes.rb,
generated/google/apis/ml_v1/representations.rb,
generated/google/apis/ml_v1/representations.rb

Overview

Represents a machine learning solution. A model can have multiple versions, each of which is a deployed, trained model ready to receive prediction requests. The model itself is just a container.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ GoogleCloudMlV1Model

Returns a new instance of GoogleCloudMlV1Model



727
728
729
# File 'generated/google/apis/ml_v1/classes.rb', line 727

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#default_versionGoogle::Apis::MlV1::GoogleCloudMlV1Version

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. Corresponds to the JSON property defaultVersion



671
672
673
# File 'generated/google/apis/ml_v1/classes.rb', line 671

def default_version
  @default_version
end

#descriptionString

Optional. The description specified for the model when it was created. Corresponds to the JSON property description

Returns:

  • (String)


676
677
678
# File 'generated/google/apis/ml_v1/classes.rb', line 676

def description
  @description
end

#etagString

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 GetModel, and systems are expected to put that etag in the request to UpdateModel to ensure that their change will be applied to the model as intended. Corresponds to the JSON property etag NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


688
689
690
# File 'generated/google/apis/ml_v1/classes.rb', line 688

def etag
  @etag
end

#labelsHash<String,String>

Optional. One or more labels that you can add, to organize your models. 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. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


697
698
699
# File 'generated/google/apis/ml_v1/classes.rb', line 697

def labels
  @labels
end

#nameString

Required. The name specified for the model when it was created. The model name must be unique within the project it is created in. Corresponds to the JSON property name

Returns:

  • (String)


703
704
705
# File 'generated/google/apis/ml_v1/classes.rb', line 703

def name
  @name
end

#online_prediction_loggingBoolean Also known as: online_prediction_logging?

Optional. If true, enables StackDriver Logging for online prediction. Default is false. Corresponds to the JSON property onlinePredictionLogging

Returns:

  • (Boolean)


709
710
711
# File 'generated/google/apis/ml_v1/classes.rb', line 709

def online_prediction_logging
  @online_prediction_logging
end

#regionsArray<String>

Optional. The list of regions where the model is going to be deployed. Currently only one region per model is supported. Defaults to 'us-central1' if nothing is set. See the available regions for ML Engine services. Note:

  • No matter where a model is deployed, it can always be accessed by users from anywhere, both for online and batch prediction.
  • The region for a batch prediction job is set by the region field when submitting the batch prediction job and does not take its value from this field. Corresponds to the JSON property regions

Returns:

  • (Array<String>)


725
726
727
# File 'generated/google/apis/ml_v1/classes.rb', line 725

def regions
  @regions
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



732
733
734
735
736
737
738
739
740
# File 'generated/google/apis/ml_v1/classes.rb', line 732

def update!(**args)
  @default_version = args[:default_version] if args.key?(:default_version)
  @description = args[:description] if args.key?(:description)
  @etag = args[:etag] if args.key?(:etag)
  @labels = args[:labels] if args.key?(:labels)
  @name = args[:name] if args.key?(:name)
  @online_prediction_logging = args[:online_prediction_logging] if args.key?(:online_prediction_logging)
  @regions = args[:regions] if args.key?(:regions)
end