Class: Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaModel

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

Overview

Metadata that describes the training and serving parameters of a Model. A Model can be associated with a ServingConfig and then queried through the Predict api.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRetailV2alphaModel

Returns a new instance of GoogleCloudRetailV2alphaModel.



2607
2608
2609
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2607

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

Instance Attribute Details

#create_timeString

Output only. Timestamp the Recommendation Model was created at. Corresponds to the JSON property createTime

Returns:

  • (String)


2511
2512
2513
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2511

def create_time
  @create_time
end

#data_stateString

Output only. The state of data requirements for this model: DATA_OK and DATA_ERROR. Recommendation model cannot be trained if the data is in DATA_ERROR state. Recommendation model can have DATA_ERROR state even if serving state is ACTIVE: models were trained successfully before, but cannot be refreshed because model no longer has sufficient data for training. Corresponds to the JSON property dataState

Returns:

  • (String)


2520
2521
2522
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2520

def data_state
  @data_state
end

#display_nameString

Required. The display name of the model. Should be human readable, used to display Recommendation Models in the Retail Pantheon Dashboard. UTF-8 encoded string with limit of 1024 characters. Corresponds to the JSON property displayName

Returns:

  • (String)


2527
2528
2529
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2527

def display_name
  @display_name
end

#filtering_optionString

Optional. If RECOMMENDATIONS_FILTERING_ENABLED, recommendation filtering by attributes is enabled for the model. Corresponds to the JSON property filteringOption

Returns:

  • (String)


2533
2534
2535
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2533

def filtering_option
  @filtering_option
end

#last_tune_timeString

Output only. The timestamp when the latest successful tune finished. Corresponds to the JSON property lastTuneTime

Returns:

  • (String)


2538
2539
2540
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2538

def last_tune_time
  @last_tune_time
end

#nameString

Required. The fully qualified resource name of the model. Format: projects/ project_number/locations/location_id/catalogs/catalog_id/models/model_id catalog_id has char limit of 50. recommendation_model_id has char limit of 40. Corresponds to the JSON property name

Returns:

  • (String)


2545
2546
2547
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2545

def name
  @name
end

#optimization_objectiveString

Optional. The optimization objective e.g. cvr. Currently supported values: ctr, cvr, revenue-per-order. If not specified, we choose default based on model type. Default depends on type of recommendation: recommended-for-you => ctr others-you-may-like => ctr frequently-bought-together => revenue_per_order Corresponds to the JSON property optimizationObjective

Returns:

  • (String)


2554
2555
2556
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2554

def optimization_objective
  @optimization_objective
end

#page_optimization_configGoogle::Apis::RetailV2alpha::GoogleCloudRetailV2alphaModelPageOptimizationConfig

The PageOptimizationConfig for model training. This determines how many panels to optimize for, and which serving configurations to consider for each panel. The purpose of this model is to optimize which ServingConfig to show on which panels in way that optimizes the visitors shopping journey. Corresponds to the JSON property pageOptimizationConfig



2562
2563
2564
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2562

def page_optimization_config
  @page_optimization_config
end

#periodic_tuning_stateString

Optional. The state of periodic tuning. The period we use is 3 months - to do a one-off tune earlier use the TuneModel method. Default value is PERIODIC_TUNING_ENABLED. Corresponds to the JSON property periodicTuningState

Returns:

  • (String)


2569
2570
2571
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2569

def periodic_tuning_state
  @periodic_tuning_state
end

#serving_stateString

Output only. The serving state of the model: ACTIVE, NOT_ACTIVE. Corresponds to the JSON property servingState

Returns:

  • (String)


2574
2575
2576
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2574

def serving_state
  @serving_state
end

#training_stateString

Optional. The training state that the model is in (e.g. TRAINING or PAUSED). Since part of the cost of running the service is frequency of training - this can be used to determine when to train model in order to control cost. If not specified: the default value for CreateModel method is TRAINING. the default value for UpdateModel method is to keep the state the same as before. Corresponds to the JSON property trainingState

Returns:

  • (String)


2583
2584
2585
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2583

def training_state
  @training_state
end

#tuning_operationString

Output only. The tune operation associated with the model. Can be used to determine if there is an ongoing tune for this recommendation. Empty field implies no tune is goig on. Corresponds to the JSON property tuningOperation

Returns:

  • (String)


2590
2591
2592
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2590

def tuning_operation
  @tuning_operation
end

#typeString

Required. The type of model e.g. home-page. Currently supported values: recommended-for-you, others-you-may-like, frequently-bought-together, page-optimization, 'similar-items', 'buy-it-again', recently-viewed( readonly value). Corresponds to the JSON property type

Returns:

  • (String)


2598
2599
2600
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2598

def type
  @type
end

#update_timeString

Output only. Timestamp the Recommendation Model was last updated. E.g. if a Recommendation Model was paused - this would be the time the pause was initiated. Corresponds to the JSON property updateTime

Returns:

  • (String)


2605
2606
2607
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2605

def update_time
  @update_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 2612

def update!(**args)
  @create_time = args[:create_time] if args.key?(:create_time)
  @data_state = args[:data_state] if args.key?(:data_state)
  @display_name = args[:display_name] if args.key?(:display_name)
  @filtering_option = args[:filtering_option] if args.key?(:filtering_option)
  @last_tune_time = args[:last_tune_time] if args.key?(:last_tune_time)
  @name = args[:name] if args.key?(:name)
  @optimization_objective = args[:optimization_objective] if args.key?(:optimization_objective)
  @page_optimization_config = args[:page_optimization_config] if args.key?(:page_optimization_config)
  @periodic_tuning_state = args[:periodic_tuning_state] if args.key?(:periodic_tuning_state)
  @serving_state = args[:serving_state] if args.key?(:serving_state)
  @training_state = args[:training_state] if args.key?(:training_state)
  @tuning_operation = args[:tuning_operation] if args.key?(:tuning_operation)
  @type = args[:type] if args.key?(:type)
  @update_time = args[:update_time] if args.key?(:update_time)
end