Class: Google::Apis::BigqueryV2::TrainingOptions

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

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) ⇒ TrainingOptions

Returns a new instance of TrainingOptions



5017
5018
5019
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5017

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

Instance Attribute Details

#data_split_columnString

The column to split data with. This column won't be used as a feature.

  1. When data_split_method is CUSTOM, the corresponding column should be boolean. The rows with true value tag are eval data, and the false are training data.
  2. When data_split_method is SEQ, the first DATA_SPLIT_EVAL_FRACTION rows (from smallest to largest) in the corresponding column are used as training data, and the rest are eval data. It respects the order in Orderable data types: https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data- type-properties Corresponds to the JSON property dataSplitColumn

Returns:

  • (String)


4927
4928
4929
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4927

def data_split_column
  @data_split_column
end

#data_split_eval_fractionFloat

The fraction of evaluation data over the whole input data. The rest of data will be used as training data. The format should be double. Accurate to two decimal places. Default value is 0.2. Corresponds to the JSON property dataSplitEvalFraction

Returns:

  • (Float)


4935
4936
4937
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4935

def data_split_eval_fraction
  @data_split_eval_fraction
end

#data_split_methodString

The data split type for training and evaluation, e.g. RANDOM. Corresponds to the JSON property dataSplitMethod

Returns:

  • (String)


4940
4941
4942
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4940

def data_split_method
  @data_split_method
end

#distance_typeString

[Beta] Distance type for clustering models. Corresponds to the JSON property distanceType

Returns:

  • (String)


4945
4946
4947
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4945

def distance_type
  @distance_type
end

#early_stopBoolean Also known as: early_stop?

Whether to stop early when the loss doesn't improve significantly any more (compared to min_relative_progress). Corresponds to the JSON property earlyStop

Returns:

  • (Boolean)


4951
4952
4953
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4951

def early_stop
  @early_stop
end

#initial_learn_rateFloat

Specifies the initial learning rate for line search to start at. Corresponds to the JSON property initialLearnRate

Returns:

  • (Float)


4957
4958
4959
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4957

def initial_learn_rate
  @initial_learn_rate
end

#input_label_columnsArray<String>

Name of input label columns in training data. Corresponds to the JSON property inputLabelColumns

Returns:

  • (Array<String>)


4962
4963
4964
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4962

def input_label_columns
  @input_label_columns
end

#l1_regularizationFloat

L1 regularization coefficient. Corresponds to the JSON property l1Regularization

Returns:

  • (Float)


4967
4968
4969
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4967

def l1_regularization
  @l1_regularization
end

#l2_regularizationFloat

L2 regularization coefficient. Corresponds to the JSON property l2Regularization

Returns:

  • (Float)


4972
4973
4974
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4972

def l2_regularization
  @l2_regularization
end

#label_class_weightsHash<String,Float>

Weights associated with each label class, for rebalancing the training data. Corresponds to the JSON property labelClassWeights

Returns:

  • (Hash<String,Float>)


4978
4979
4980
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4978

def label_class_weights
  @label_class_weights
end

#learn_rateFloat

Learning rate in training. Corresponds to the JSON property learnRate

Returns:

  • (Float)


4983
4984
4985
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4983

def learn_rate
  @learn_rate
end

#learn_rate_strategyString

The strategy to determine learning rate. Corresponds to the JSON property learnRateStrategy

Returns:

  • (String)


4988
4989
4990
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4988

def learn_rate_strategy
  @learn_rate_strategy
end

#loss_typeString

Type of loss function used during training run. Corresponds to the JSON property lossType

Returns:

  • (String)


4993
4994
4995
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4993

def loss_type
  @loss_type
end

#max_iterationsFixnum

The maximum number of iterations in training. Corresponds to the JSON property maxIterations

Returns:

  • (Fixnum)


4998
4999
5000
# File 'generated/google/apis/bigquery_v2/classes.rb', line 4998

def max_iterations
  @max_iterations
end

#min_relative_progressFloat

When early_stop is true, stops training when accuracy improvement is less than 'min_relative_progress'. Corresponds to the JSON property minRelativeProgress

Returns:

  • (Float)


5004
5005
5006
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5004

def min_relative_progress
  @min_relative_progress
end

#num_clustersFixnum

[Beta] Number of clusters for clustering models. Corresponds to the JSON property numClusters

Returns:

  • (Fixnum)


5009
5010
5011
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5009

def num_clusters
  @num_clusters
end

#warm_startBoolean Also known as: warm_start?

Whether to train a model from the last checkpoint. Corresponds to the JSON property warmStart

Returns:

  • (Boolean)


5014
5015
5016
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5014

def warm_start
  @warm_start
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5022

def update!(**args)
  @data_split_column = args[:data_split_column] if args.key?(:data_split_column)
  @data_split_eval_fraction = args[:data_split_eval_fraction] if args.key?(:data_split_eval_fraction)
  @data_split_method = args[:data_split_method] if args.key?(:data_split_method)
  @distance_type = args[:distance_type] if args.key?(:distance_type)
  @early_stop = args[:early_stop] if args.key?(:early_stop)
  @initial_learn_rate = args[:initial_learn_rate] if args.key?(:initial_learn_rate)
  @input_label_columns = args[:input_label_columns] if args.key?(:input_label_columns)
  @l1_regularization = args[:l1_regularization] if args.key?(:l1_regularization)
  @l2_regularization = args[:l2_regularization] if args.key?(:l2_regularization)
  @label_class_weights = args[:label_class_weights] if args.key?(:label_class_weights)
  @learn_rate = args[:learn_rate] if args.key?(:learn_rate)
  @learn_rate_strategy = args[:learn_rate_strategy] if args.key?(:learn_rate_strategy)
  @loss_type = args[:loss_type] if args.key?(:loss_type)
  @max_iterations = args[:max_iterations] if args.key?(:max_iterations)
  @min_relative_progress = args[:min_relative_progress] if args.key?(:min_relative_progress)
  @num_clusters = args[:num_clusters] if args.key?(:num_clusters)
  @warm_start = args[:warm_start] if args.key?(:warm_start)
end