Class: Google::Apis::BigqueryV2::TrainingOptions
- Inherits:
-
Object
- Object
- Google::Apis::BigqueryV2::TrainingOptions
- 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
-
#auto_arima ⇒ Boolean
(also: #auto_arima?)
Whether to enable auto ARIMA or not.
-
#auto_arima_max_order ⇒ Fixnum
The max value of non-seasonal p and q.
-
#batch_size ⇒ Fixnum
Batch size for dnn models.
-
#data_frequency ⇒ String
The data frequency of a time series.
-
#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
Distance type for clustering models.
-
#dropout ⇒ Float
Dropout probability for dnn 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).
-
#feedback_type ⇒ String
Feedback type that specifies which algorithm to run for matrix factorization.
-
#hidden_units ⇒ Array<Fixnum>
Hidden units for dnn models.
-
#holiday_region ⇒ String
The geographical region based on which the holidays are considered in time series modeling.
-
#horizon ⇒ Fixnum
The number of periods ahead that need to be forecasted.
-
#include_drift ⇒ Boolean
(also: #include_drift?)
Include drift when fitting an ARIMA model.
-
#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.
-
#item_column ⇒ String
Item column specified for matrix factorization models.
-
#kmeans_initialization_column ⇒ String
The column used to provide the initial centroids for kmeans algorithm when kmeans_initialization_method is CUSTOM.
-
#kmeans_initialization_method ⇒ String
The method used to initialize the centroids for kmeans algorithm.
-
#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.
-
#max_tree_depth ⇒ Fixnum
Maximum depth of a tree for boosted tree models.
-
#min_relative_progress ⇒ Float
When early_stop is true, stops training when accuracy improvement is less than 'min_relative_progress'.
-
#min_split_loss ⇒ Float
Minimum split loss for boosted tree models.
-
#model_uri ⇒ String
Google Cloud Storage URI from which the model was imported.
-
#non_seasonal_order ⇒ Google::Apis::BigqueryV2::ArimaOrder
Arima order, can be used for both non-seasonal and seasonal parts.
-
#num_clusters ⇒ Fixnum
Number of clusters for clustering models.
-
#num_factors ⇒ Fixnum
Num factors specified for matrix factorization models.
-
#optimization_strategy ⇒ String
Optimization strategy for training linear regression models.
-
#preserve_input_structs ⇒ Boolean
(also: #preserve_input_structs?)
Whether to preserve the input structs in output feature names.
-
#subsample ⇒ Float
Subsample fraction of the training data to grow tree to prevent overfitting for boosted tree models.
-
#time_series_data_column ⇒ String
Column to be designated as time series data for ARIMA model.
-
#time_series_id_column ⇒ String
The time series id column that was used during ARIMA model training.
-
#time_series_timestamp_column ⇒ String
Column to be designated as time series timestamp for ARIMA model.
-
#user_column ⇒ String
User column specified for matrix factorization models.
-
#wals_alpha ⇒ Float
Hyperparameter for matrix factoration when implicit feedback type is specified.
-
#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.
Constructor Details
#initialize(**args) ⇒ TrainingOptions
Returns a new instance of TrainingOptions.
7148 7149 7150 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7148 def initialize(**args) update!(**args) end |
Instance Attribute Details
#auto_arima ⇒ Boolean Also known as: auto_arima?
Whether to enable auto ARIMA or not.
Corresponds to the JSON property autoArima
6910 6911 6912 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6910 def auto_arima @auto_arima end |
#auto_arima_max_order ⇒ Fixnum
The max value of non-seasonal p and q.
Corresponds to the JSON property autoArimaMaxOrder
6916 6917 6918 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6916 def auto_arima_max_order @auto_arima_max_order end |
#batch_size ⇒ Fixnum
Batch size for dnn models.
Corresponds to the JSON property batchSize
6921 6922 6923 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6921 def batch_size @batch_size end |
#data_frequency ⇒ String
The data frequency of a time series.
Corresponds to the JSON property dataFrequency
6926 6927 6928 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6926 def data_frequency @data_frequency end |
#data_split_column ⇒ String
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
6938 6939 6940 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6938 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
6945 6946 6947 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6945 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
6950 6951 6952 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6950 def data_split_method @data_split_method end |
#distance_type ⇒ String
Distance type for clustering models.
Corresponds to the JSON property distanceType
6955 6956 6957 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6955 def distance_type @distance_type end |
#dropout ⇒ Float
Dropout probability for dnn models.
Corresponds to the JSON property dropout
6960 6961 6962 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6960 def dropout @dropout 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
6967 6968 6969 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6967 def early_stop @early_stop end |
#feedback_type ⇒ String
Feedback type that specifies which algorithm to run for matrix factorization.
Corresponds to the JSON property feedbackType
6973 6974 6975 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6973 def feedback_type @feedback_type end |
#hidden_units ⇒ Array<Fixnum>
Hidden units for dnn models.
Corresponds to the JSON property hiddenUnits
6978 6979 6980 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6978 def hidden_units @hidden_units end |
#holiday_region ⇒ String
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
6985 6986 6987 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6985 def holiday_region @holiday_region end |
#horizon ⇒ Fixnum
The number of periods ahead that need to be forecasted.
Corresponds to the JSON property horizon
6990 6991 6992 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6990 def horizon @horizon end |
#include_drift ⇒ Boolean Also known as: include_drift?
Include drift when fitting an ARIMA model.
Corresponds to the JSON property includeDrift
6995 6996 6997 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 6995 def include_drift @include_drift end |
#initial_learn_rate ⇒ Float
Specifies the initial learning rate for the line search learn rate strategy.
Corresponds to the JSON property initialLearnRate
7001 7002 7003 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7001 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
7006 7007 7008 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7006 def input_label_columns @input_label_columns end |
#item_column ⇒ String
Item column specified for matrix factorization models.
Corresponds to the JSON property itemColumn
7011 7012 7013 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7011 def item_column @item_column end |
#kmeans_initialization_column ⇒ String
The column used to provide the initial centroids for kmeans algorithm when
kmeans_initialization_method is CUSTOM.
Corresponds to the JSON property kmeansInitializationColumn
7017 7018 7019 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7017 def kmeans_initialization_column @kmeans_initialization_column end |
#kmeans_initialization_method ⇒ String
The method used to initialize the centroids for kmeans algorithm.
Corresponds to the JSON property kmeansInitializationMethod
7022 7023 7024 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7022 def kmeans_initialization_method @kmeans_initialization_method end |
#l1_regularization ⇒ Float
L1 regularization coefficient.
Corresponds to the JSON property l1Regularization
7027 7028 7029 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7027 def l1_regularization @l1_regularization end |
#l2_regularization ⇒ Float
L2 regularization coefficient.
Corresponds to the JSON property l2Regularization
7032 7033 7034 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7032 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
7038 7039 7040 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7038 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
7043 7044 7045 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7043 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
7048 7049 7050 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7048 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
7053 7054 7055 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7053 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
7059 7060 7061 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7059 def max_iterations @max_iterations end |
#max_tree_depth ⇒ Fixnum
Maximum depth of a tree for boosted tree models.
Corresponds to the JSON property maxTreeDepth
7064 7065 7066 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7064 def max_tree_depth @max_tree_depth 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
7070 7071 7072 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7070 def min_relative_progress @min_relative_progress end |
#min_split_loss ⇒ Float
Minimum split loss for boosted tree models.
Corresponds to the JSON property minSplitLoss
7075 7076 7077 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7075 def min_split_loss @min_split_loss end |
#model_uri ⇒ String
Google Cloud Storage URI from which the model was imported. Only applicable
for imported models.
Corresponds to the JSON property modelUri
7081 7082 7083 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7081 def model_uri @model_uri end |
#non_seasonal_order ⇒ Google::Apis::BigqueryV2::ArimaOrder
Arima order, can be used for both non-seasonal and seasonal parts.
Corresponds to the JSON property nonSeasonalOrder
7086 7087 7088 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7086 def non_seasonal_order @non_seasonal_order end |
#num_clusters ⇒ Fixnum
Number of clusters for clustering models.
Corresponds to the JSON property numClusters
7091 7092 7093 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7091 def num_clusters @num_clusters end |
#num_factors ⇒ Fixnum
Num factors specified for matrix factorization models.
Corresponds to the JSON property numFactors
7096 7097 7098 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7096 def num_factors @num_factors end |
#optimization_strategy ⇒ String
Optimization strategy for training linear regression models.
Corresponds to the JSON property optimizationStrategy
7101 7102 7103 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7101 def optimization_strategy @optimization_strategy end |
#preserve_input_structs ⇒ Boolean 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
7108 7109 7110 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7108 def preserve_input_structs @preserve_input_structs end |
#subsample ⇒ Float
Subsample fraction of the training data to grow tree to prevent overfitting
for boosted tree models.
Corresponds to the JSON property subsample
7115 7116 7117 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7115 def subsample @subsample end |
#time_series_data_column ⇒ String
Column to be designated as time series data for ARIMA model.
Corresponds to the JSON property timeSeriesDataColumn
7120 7121 7122 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7120 def time_series_data_column @time_series_data_column end |
#time_series_id_column ⇒ String
The time series id column that was used during ARIMA model training.
Corresponds to the JSON property timeSeriesIdColumn
7125 7126 7127 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7125 def time_series_id_column @time_series_id_column end |
#time_series_timestamp_column ⇒ String
Column to be designated as time series timestamp for ARIMA model.
Corresponds to the JSON property timeSeriesTimestampColumn
7130 7131 7132 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7130 def @time_series_timestamp_column end |
#user_column ⇒ String
User column specified for matrix factorization models.
Corresponds to the JSON property userColumn
7135 7136 7137 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7135 def user_column @user_column end |
#wals_alpha ⇒ Float
Hyperparameter for matrix factoration when implicit feedback type is specified.
Corresponds to the JSON property walsAlpha
7140 7141 7142 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7140 def wals_alpha @wals_alpha end |
#warm_start ⇒ Boolean Also known as: warm_start?
Whether to train a model from the last checkpoint.
Corresponds to the JSON property warmStart
7145 7146 7147 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7145 def warm_start @warm_start end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 |
# File 'lib/google/apis/bigquery_v2/classes.rb', line 7153 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 |