Class: Google::Apis::BigqueryV2::TrainingOptions
- Inherits:
-
Object
- Object
- Google::Apis::BigqueryV2::TrainingOptions
- 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
-
#data_split_column ⇒ String
The column to split data with.
-
#data_split_eval_fraction ⇒ Float
The fraction of evaluation data over the whole input data.
-
#data_split_method ⇒ String
The data split type for training and evaluation, e.g.
-
#distance_type ⇒ String
[Beta] Distance type for clustering models.
-
#early_stop ⇒ Boolean
(also: #early_stop?)
Whether to stop early when the loss doesn't improve significantly any more (compared to min_relative_progress).
-
#initial_learn_rate ⇒ Float
Specifies the initial learning rate for the line search learn rate strategy.
-
#input_label_columns ⇒ Array<String>
Name of input label columns in training data.
-
#l1_regularization ⇒ Float
L1 regularization coefficient.
-
#l2_regularization ⇒ Float
L2 regularization coefficient.
-
#label_class_weights ⇒ Hash<String,Float>
Weights associated with each label class, for rebalancing the training data.
-
#learn_rate ⇒ Float
Learning rate in training.
-
#learn_rate_strategy ⇒ String
The strategy to determine learn rate for the current iteration.
-
#loss_type ⇒ String
Type of loss function used during training run.
-
#max_iterations ⇒ Fixnum
The maximum number of iterations in training.
-
#min_relative_progress ⇒ Float
When early_stop is true, stops training when accuracy improvement is less than 'min_relative_progress'.
-
#model_uri ⇒ String
[Beta] Google Cloud Storage URI from which the model was imported.
-
#num_clusters ⇒ Fixnum
[Beta] Number of clusters for clustering models.
-
#optimization_strategy ⇒ String
Optimization strategy for training linear regression models.
-
#warm_start ⇒ Boolean
(also: #warm_start?)
Whether to train a model from the last checkpoint.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TrainingOptions
constructor
A new instance of TrainingOptions.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ TrainingOptions
Returns a new instance of TrainingOptions
5296 5297 5298 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5296 def initialize(**args) update!(**args) end |
Instance Attribute Details
#data_split_column ⇒ String
The column to split data with. This column won't be used as a feature.
- 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.
- 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
5191 5192 5193 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5191 def data_split_column @data_split_column end |
#data_split_eval_fraction ⇒ Float
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
5199 5200 5201 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5199 def data_split_eval_fraction @data_split_eval_fraction end |
#data_split_method ⇒ String
The data split type for training and evaluation, e.g. RANDOM.
Corresponds to the JSON property dataSplitMethod
5204 5205 5206 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5204 def data_split_method @data_split_method end |
#distance_type ⇒ String
[Beta] Distance type for clustering models.
Corresponds to the JSON property distanceType
5209 5210 5211 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5209 def distance_type @distance_type end |
#early_stop ⇒ Boolean Also known as: early_stop?
Whether to stop early when the loss doesn't improve significantly
any more (compared to min_relative_progress). Used only for iterative
training algorithms.
Corresponds to the JSON property earlyStop
5216 5217 5218 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5216 def early_stop @early_stop end |
#initial_learn_rate ⇒ Float
Specifies the initial learning rate for the line search learn rate
strategy.
Corresponds to the JSON property initialLearnRate
5223 5224 5225 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5223 def initial_learn_rate @initial_learn_rate end |
#input_label_columns ⇒ Array<String>
Name of input label columns in training data.
Corresponds to the JSON property inputLabelColumns
5228 5229 5230 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5228 def input_label_columns @input_label_columns end |
#l1_regularization ⇒ Float
L1 regularization coefficient.
Corresponds to the JSON property l1Regularization
5233 5234 5235 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5233 def l1_regularization @l1_regularization end |
#l2_regularization ⇒ Float
L2 regularization coefficient.
Corresponds to the JSON property l2Regularization
5238 5239 5240 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5238 def l2_regularization @l2_regularization end |
#label_class_weights ⇒ Hash<String,Float>
Weights associated with each label class, for rebalancing the
training data. Only applicable for classification models.
Corresponds to the JSON property labelClassWeights
5244 5245 5246 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5244 def label_class_weights @label_class_weights end |
#learn_rate ⇒ Float
Learning rate in training. Used only for iterative training algorithms.
Corresponds to the JSON property learnRate
5249 5250 5251 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5249 def learn_rate @learn_rate end |
#learn_rate_strategy ⇒ String
The strategy to determine learn rate for the current iteration.
Corresponds to the JSON property learnRateStrategy
5254 5255 5256 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5254 def learn_rate_strategy @learn_rate_strategy end |
#loss_type ⇒ String
Type of loss function used during training run.
Corresponds to the JSON property lossType
5259 5260 5261 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5259 def loss_type @loss_type end |
#max_iterations ⇒ Fixnum
The maximum number of iterations in training. Used only for iterative
training algorithms.
Corresponds to the JSON property maxIterations
5265 5266 5267 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5265 def max_iterations @max_iterations end |
#min_relative_progress ⇒ Float
When early_stop is true, stops training when accuracy improvement is
less than 'min_relative_progress'. Used only for iterative training
algorithms.
Corresponds to the JSON property minRelativeProgress
5272 5273 5274 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5272 def min_relative_progress @min_relative_progress end |
#model_uri ⇒ String
[Beta] Google Cloud Storage URI from which the model was imported. Only
applicable for imported models.
Corresponds to the JSON property modelUri
5278 5279 5280 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5278 def model_uri @model_uri end |
#num_clusters ⇒ Fixnum
[Beta] Number of clusters for clustering models.
Corresponds to the JSON property numClusters
5283 5284 5285 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5283 def num_clusters @num_clusters end |
#optimization_strategy ⇒ String
Optimization strategy for training linear regression models.
Corresponds to the JSON property optimizationStrategy
5288 5289 5290 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5288 def optimization_strategy @optimization_strategy end |
#warm_start ⇒ Boolean Also known as: warm_start?
Whether to train a model from the last checkpoint.
Corresponds to the JSON property warmStart
5293 5294 5295 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5293 def warm_start @warm_start end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 |
# File 'generated/google/apis/bigquery_v2/classes.rb', line 5301 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) @model_uri = args[:model_uri] if args.key?(:model_uri) @num_clusters = args[:num_clusters] if args.key?(:num_clusters) @optimization_strategy = args[:optimization_strategy] if args.key?(:optimization_strategy) @warm_start = args[:warm_start] if args.key?(:warm_start) end |