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

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

Overview

Options used in model training.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TrainingOptions

Returns a new instance of TrainingOptions.



7030
7031
7032
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7030

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

Instance Attribute Details

#auto_arimaBoolean Also known as: auto_arima?

Whether to enable auto ARIMA or not. Corresponds to the JSON property autoArima

Returns:

  • (Boolean)


6792
6793
6794
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6792

def auto_arima
  @auto_arima
end

#auto_arima_max_orderFixnum

The max value of non-seasonal p and q. Corresponds to the JSON property autoArimaMaxOrder

Returns:

  • (Fixnum)


6798
6799
6800
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6798

def auto_arima_max_order
  @auto_arima_max_order
end

#batch_sizeFixnum

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

Returns:

  • (Fixnum)


6803
6804
6805
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6803

def batch_size
  @batch_size
end

#data_frequencyString

The data frequency of a time series. Corresponds to the JSON property dataFrequency

Returns:

  • (String)


6808
6809
6810
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6808

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


6820
6821
6822
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6820

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)


6827
6828
6829
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6827

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)


6832
6833
6834
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6832

def data_split_method
  @data_split_method
end

#distance_typeString

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

Returns:

  • (String)


6837
6838
6839
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6837

def distance_type
  @distance_type
end

#dropoutFloat

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

Returns:

  • (Float)


6842
6843
6844
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6842

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)


6849
6850
6851
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6849

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)


6855
6856
6857
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6855

def feedback_type
  @feedback_type
end

#hidden_unitsArray<Fixnum>

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

Returns:

  • (Array<Fixnum>)


6860
6861
6862
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6860

def hidden_units
  @hidden_units
end

#holiday_regionString

The geographical region based on which the holidays are considered in time series modeling. If a valid value is specified, then holiday effects modeling is enabled. Corresponds to the JSON property holidayRegion

Returns:

  • (String)


6867
6868
6869
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6867

def holiday_region
  @holiday_region
end

#horizonFixnum

The number of periods ahead that need to be forecasted. Corresponds to the JSON property horizon

Returns:

  • (Fixnum)


6872
6873
6874
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6872

def horizon
  @horizon
end

#include_driftBoolean Also known as: include_drift?

Include drift when fitting an ARIMA model. Corresponds to the JSON property includeDrift

Returns:

  • (Boolean)


6877
6878
6879
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6877

def include_drift
  @include_drift
end

#initial_learn_rateFloat

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

Returns:

  • (Float)


6883
6884
6885
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6883

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


6888
6889
6890
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6888

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)


6893
6894
6895
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6893

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)


6899
6900
6901
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6899

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)


6904
6905
6906
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6904

def kmeans_initialization_method
  @kmeans_initialization_method
end

#l1_regularizationFloat

L1 regularization coefficient. Corresponds to the JSON property l1Regularization

Returns:

  • (Float)


6909
6910
6911
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6909

def l1_regularization
  @l1_regularization
end

#l2_regularizationFloat

L2 regularization coefficient. Corresponds to the JSON property l2Regularization

Returns:

  • (Float)


6914
6915
6916
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6914

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


6920
6921
6922
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6920

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)


6925
6926
6927
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6925

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)


6930
6931
6932
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6930

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)


6935
6936
6937
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6935

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)


6941
6942
6943
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6941

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)


6946
6947
6948
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6946

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)


6952
6953
6954
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6952

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)


6957
6958
6959
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6957

def min_split_loss
  @min_split_loss
end

#model_uriString

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

Returns:

  • (String)


6963
6964
6965
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6963

def model_uri
  @model_uri
end

#non_seasonal_orderGoogle::Apis::BigqueryV2::ArimaOrder

Arima order, can be used for both non-seasonal and seasonal parts. Corresponds to the JSON property nonSeasonalOrder



6968
6969
6970
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6968

def non_seasonal_order
  @non_seasonal_order
end

#num_clustersFixnum

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

Returns:

  • (Fixnum)


6973
6974
6975
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6973

def num_clusters
  @num_clusters
end

#num_factorsFixnum

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

Returns:

  • (Fixnum)


6978
6979
6980
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6978

def num_factors
  @num_factors
end

#optimization_strategyString

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

Returns:

  • (String)


6983
6984
6985
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6983

def optimization_strategy
  @optimization_strategy
end

#preserve_input_structsBoolean Also known as: preserve_input_structs?

Whether to preserve the input structs in output feature names. Suppose there is a struct A with field b. When false (default), the output feature name is A_b. When true, the output feature name is A.b. Corresponds to the JSON property preserveInputStructs

Returns:

  • (Boolean)


6990
6991
6992
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6990

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


6997
6998
6999
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6997

def subsample
  @subsample
end

#time_series_data_columnString

Column to be designated as time series data for ARIMA model. Corresponds to the JSON property timeSeriesDataColumn

Returns:

  • (String)


7002
7003
7004
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7002

def time_series_data_column
  @time_series_data_column
end

#time_series_id_columnString

The time series id column that was used during ARIMA model training. Corresponds to the JSON property timeSeriesIdColumn

Returns:

  • (String)


7007
7008
7009
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7007

def time_series_id_column
  @time_series_id_column
end

#time_series_timestamp_columnString

Column to be designated as time series timestamp for ARIMA model. Corresponds to the JSON property timeSeriesTimestampColumn

Returns:

  • (String)


7012
7013
7014
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7012

def time_series_timestamp_column
  @time_series_timestamp_column
end

#user_columnString

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

Returns:

  • (String)


7017
7018
7019
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7017

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)


7022
7023
7024
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7022

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)


7027
7028
7029
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7027

def warm_start
  @warm_start
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7035

def update!(**args)
  @auto_arima = args[:auto_arima] if args.key?(:auto_arima)
  @auto_arima_max_order = args[:auto_arima_max_order] if args.key?(:auto_arima_max_order)
  @batch_size = args[:batch_size] if args.key?(:batch_size)
  @data_frequency = args[:data_frequency] if args.key?(:data_frequency)
  @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)
  @holiday_region = args[:holiday_region] if args.key?(:holiday_region)
  @horizon = args[:horizon] if args.key?(:horizon)
  @include_drift = args[:include_drift] if args.key?(:include_drift)
  @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)
  @non_seasonal_order = args[:non_seasonal_order] if args.key?(:non_seasonal_order)
  @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)
  @preserve_input_structs = args[:preserve_input_structs] if args.key?(:preserve_input_structs)
  @subsample = args[:subsample] if args.key?(:subsample)
  @time_series_data_column = args[:time_series_data_column] if args.key?(:time_series_data_column)
  @time_series_id_column = args[:time_series_id_column] if args.key?(:time_series_id_column)
  @time_series_timestamp_column = args[:time_series_timestamp_column] if args.key?(:time_series_timestamp_column)
  @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