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.



6590
6591
6592
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6590

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

Instance Attribute Details

#batch_sizeFixnum

Batch size for dnn models. Corresponds to the JSON property batchSize

Returns:

  • (Fixnum)


6406
6407
6408
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6406

def batch_size
  @batch_size
end

#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)


6421
6422
6423
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6421

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)


6429
6430
6431
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6429

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)


6434
6435
6436
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6434

def data_split_method
  @data_split_method
end

#distance_typeString

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

Returns:

  • (String)


6439
6440
6441
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6439

def distance_type
  @distance_type
end

#dropoutFloat

Dropout probability for dnn models. Corresponds to the JSON property dropout

Returns:

  • (Float)


6444
6445
6446
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6444

def dropout
  @dropout
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). Used only for iterative training algorithms. Corresponds to the JSON property earlyStop

Returns:

  • (Boolean)


6451
6452
6453
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6451

def early_stop
  @early_stop
end

#feedback_typeString

Feedback type that specifies which algorithm to run for matrix factorization. Corresponds to the JSON property feedbackType

Returns:

  • (String)


6458
6459
6460
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6458

def feedback_type
  @feedback_type
end

#hidden_unitsArray<Fixnum>

Hidden units for dnn models. Corresponds to the JSON property hiddenUnits

Returns:

  • (Array<Fixnum>)


6463
6464
6465
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6463

def hidden_units
  @hidden_units
end

#initial_learn_rateFloat

Specifies the initial learning rate for the line search learn rate strategy. Corresponds to the JSON property initialLearnRate

Returns:

  • (Float)


6469
6470
6471
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6469

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


6474
6475
6476
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6474

def input_label_columns
  @input_label_columns
end

#item_columnString

Item column specified for matrix factorization models. Corresponds to the JSON property itemColumn

Returns:

  • (String)


6479
6480
6481
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6479

def item_column
  @item_column
end

#kmeans_initialization_columnString

The column used to provide the initial centroids for kmeans algorithm when kmeans_initialization_method is CUSTOM. Corresponds to the JSON property kmeansInitializationColumn

Returns:

  • (String)


6485
6486
6487
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6485

def kmeans_initialization_column
  @kmeans_initialization_column
end

#kmeans_initialization_methodString

The method used to initialize the centroids for kmeans algorithm. Corresponds to the JSON property kmeansInitializationMethod

Returns:

  • (String)


6490
6491
6492
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6490

def kmeans_initialization_method
  @kmeans_initialization_method
end

#l1_regularizationFloat

L1 regularization coefficient. Corresponds to the JSON property l1Regularization

Returns:

  • (Float)


6495
6496
6497
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6495

def l1_regularization
  @l1_regularization
end

#l2_regularizationFloat

L2 regularization coefficient. Corresponds to the JSON property l2Regularization

Returns:

  • (Float)


6500
6501
6502
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6500

def l2_regularization
  @l2_regularization
end

#label_class_weightsHash<String,Float>

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

Returns:

  • (Hash<String,Float>)


6506
6507
6508
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6506

def label_class_weights
  @label_class_weights
end

#learn_rateFloat

Learning rate in training. Used only for iterative training algorithms. Corresponds to the JSON property learnRate

Returns:

  • (Float)


6511
6512
6513
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6511

def learn_rate
  @learn_rate
end

#learn_rate_strategyString

The strategy to determine learn rate for the current iteration. Corresponds to the JSON property learnRateStrategy

Returns:

  • (String)


6516
6517
6518
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6516

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)


6521
6522
6523
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6521

def loss_type
  @loss_type
end

#max_iterationsFixnum

The maximum number of iterations in training. Used only for iterative training algorithms. Corresponds to the JSON property maxIterations

Returns:

  • (Fixnum)


6527
6528
6529
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6527

def max_iterations
  @max_iterations
end

#max_tree_depthFixnum

Maximum depth of a tree for boosted tree models. Corresponds to the JSON property maxTreeDepth

Returns:

  • (Fixnum)


6532
6533
6534
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6532

def max_tree_depth
  @max_tree_depth
end

#min_relative_progressFloat

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

Returns:

  • (Float)


6539
6540
6541
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6539

def min_relative_progress
  @min_relative_progress
end

#min_split_lossFloat

Minimum split loss for boosted tree models. Corresponds to the JSON property minSplitLoss

Returns:

  • (Float)


6544
6545
6546
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6544

def min_split_loss
  @min_split_loss
end

#model_uriString

[Beta] Google Cloud Storage URI from which the model was imported. Only applicable for imported models. Corresponds to the JSON property modelUri

Returns:

  • (String)


6550
6551
6552
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6550

def model_uri
  @model_uri
end

#num_clustersFixnum

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

Returns:

  • (Fixnum)


6555
6556
6557
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6555

def num_clusters
  @num_clusters
end

#num_factorsFixnum

Num factors specified for matrix factorization models. Corresponds to the JSON property numFactors

Returns:

  • (Fixnum)


6560
6561
6562
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6560

def num_factors
  @num_factors
end

#optimization_strategyString

Optimization strategy for training linear regression models. Corresponds to the JSON property optimizationStrategy

Returns:

  • (String)


6565
6566
6567
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6565

def optimization_strategy
  @optimization_strategy
end

#subsampleFloat

Subsample fraction of the training data to grow tree to prevent overfitting for boosted tree models. Corresponds to the JSON property subsample

Returns:

  • (Float)


6571
6572
6573
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6571

def subsample
  @subsample
end

#user_columnString

User column specified for matrix factorization models. Corresponds to the JSON property userColumn

Returns:

  • (String)


6576
6577
6578
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6576

def user_column
  @user_column
end

#wals_alphaFloat

Hyperparameter for matrix factoration when implicit feedback type is specified. Corresponds to the JSON property walsAlpha

Returns:

  • (Float)


6582
6583
6584
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6582

def wals_alpha
  @wals_alpha
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)


6587
6588
6589
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6587

def warm_start
  @warm_start
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
# File 'generated/google/apis/bigquery_v2/classes.rb', line 6595

def update!(**args)
  @batch_size = args[:batch_size] if args.key?(:batch_size)
  @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)
  @dropout = args[:dropout] if args.key?(:dropout)
  @early_stop = args[:early_stop] if args.key?(:early_stop)
  @feedback_type = args[:feedback_type] if args.key?(:feedback_type)
  @hidden_units = args[:hidden_units] if args.key?(:hidden_units)
  @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)
  @item_column = args[:item_column] if args.key?(:item_column)
  @kmeans_initialization_column = args[:kmeans_initialization_column] if args.key?(:kmeans_initialization_column)
  @kmeans_initialization_method = args[:kmeans_initialization_method] if args.key?(:kmeans_initialization_method)
  @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)
  @max_tree_depth = args[:max_tree_depth] if args.key?(:max_tree_depth)
  @min_relative_progress = args[:min_relative_progress] if args.key?(:min_relative_progress)
  @min_split_loss = args[:min_split_loss] if args.key?(:min_split_loss)
  @model_uri = args[:model_uri] if args.key?(:model_uri)
  @num_clusters = args[:num_clusters] if args.key?(:num_clusters)
  @num_factors = args[:num_factors] if args.key?(:num_factors)
  @optimization_strategy = args[:optimization_strategy] if args.key?(:optimization_strategy)
  @subsample = args[:subsample] if args.key?(:subsample)
  @user_column = args[:user_column] if args.key?(:user_column)
  @wals_alpha = args[:wals_alpha] if args.key?(:wals_alpha)
  @warm_start = args[:warm_start] if args.key?(:warm_start)
end