Class TrainingOptions

Options used in model training.

Attributes
NameDescription
intmax_iterations
The maximum number of iterations in training. Used only for iterative training algorithms.
google.cloud.bigquery_v2.types.Model.LossTypeloss_type
Type of loss function used during training run.
floatlearn_rate
Learning rate in training. Used only for iterative training algorithms.
google.protobuf.wrappers_pb2.DoubleValuel1_regularization
L1 regularization coefficient.
google.protobuf.wrappers_pb2.DoubleValuel2_regularization
L2 regularization coefficient.
google.protobuf.wrappers_pb2.DoubleValuemin_relative_progress
When early_stop is true, stops training when accuracy improvement is less than 'min_relative_progress'. Used only for iterative training algorithms.
google.protobuf.wrappers_pb2.BoolValuewarm_start
Whether to train a model from the last checkpoint.
google.protobuf.wrappers_pb2.BoolValueearly_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.
Sequence[str]input_label_columns
Name of input label columns in training data.
google.cloud.bigquery_v2.types.Model.DataSplitMethoddata_split_method
The data split type for training and evaluation, e.g. RANDOM.
floatdata_split_eval_fraction
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.
strdata_split_column
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
google.cloud.bigquery_v2.types.Model.LearnRateStrategylearn_rate_strategy
The strategy to determine learn rate for the current iteration.
floatinitial_learn_rate
Specifies the initial learning rate for the line search learn rate strategy.
Sequence[google.cloud.bigquery_v2.types.Model.TrainingRun.TrainingOptions.LabelClassWeightsEntry]label_class_weights
Weights associated with each label class, for rebalancing the training data. Only applicable for classification models.
struser_column
User column specified for matrix factorization models.
stritem_column
Item column specified for matrix factorization models.
google.cloud.bigquery_v2.types.Model.DistanceTypedistance_type
Distance type for clustering models.
intnum_clusters
Number of clusters for clustering models.
strmodel_uri
Google Cloud Storage URI from which the model was imported. Only applicable for imported models.
google.cloud.bigquery_v2.types.Model.OptimizationStrategyoptimization_strategy
Optimization strategy for training linear regression models.
Sequence[int]hidden_units
Hidden units for dnn models.
intbatch_size
Batch size for dnn models.
google.protobuf.wrappers_pb2.DoubleValuedropout
Dropout probability for dnn models.
intmax_tree_depth
Maximum depth of a tree for boosted tree models.
floatsubsample
Subsample fraction of the training data to grow tree to prevent overfitting for boosted tree models.
google.protobuf.wrappers_pb2.DoubleValuemin_split_loss
Minimum split loss for boosted tree models.
intnum_factors
Num factors specified for matrix factorization models.
google.cloud.bigquery_v2.types.Model.FeedbackTypefeedback_type
Feedback type that specifies which algorithm to run for matrix factorization.
google.protobuf.wrappers_pb2.DoubleValuewals_alpha
Hyperparameter for matrix factoration when implicit feedback type is specified.
google.cloud.bigquery_v2.types.Model.KmeansEnums.KmeansInitializationMethodkmeans_initialization_method
The method used to initialize the centroids for kmeans algorithm.
strkmeans_initialization_column
The column used to provide the initial centroids for kmeans algorithm when kmeans_initialization_method is CUSTOM.
strtime_series_timestamp_column
Column to be designated as time series timestamp for ARIMA model.
strtime_series_data_column
Column to be designated as time series data for ARIMA model.
boolauto_arima
Whether to enable auto ARIMA or not.
google.cloud.bigquery_v2.types.Model.ArimaOrdernon_seasonal_order
A specification of the non-seasonal part of the ARIMA model: the three components (p, d, q) are the AR order, the degree of differencing, and the MA order.
google.cloud.bigquery_v2.types.Model.DataFrequencydata_frequency
The data frequency of a time series.
boolinclude_drift
Include drift when fitting an ARIMA model.
google.cloud.bigquery_v2.types.Model.HolidayRegionholiday_region
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.
strtime_series_id_column
The time series id column that was used during ARIMA model training.
Sequence[str]time_series_id_columns
The time series id columns that were used during ARIMA model training.
inthorizon
The number of periods ahead that need to be forecasted.
boolpreserve_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.
intauto_arima_max_order
The max value of non-seasonal p and q.
google.protobuf.wrappers_pb2.BoolValuedecompose_time_series
If true, perform decompose time series and save the results.
google.protobuf.wrappers_pb2.BoolValueclean_spikes_and_dips
If true, clean spikes and dips in the input time series.
google.protobuf.wrappers_pb2.BoolValueadjust_step_changes
If true, detect step changes and make data adjustment in the input time series.

Inheritance

builtins.object > proto.message.Message > TrainingOptions

Classes

LabelClassWeightsEntry

LabelClassWeightsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

API documentation for bigquery_v2.types.Model.TrainingRun.TrainingOptions.LabelClassWeightsEntry class.

Methods

__bool__

__bool__()

Return True if any field is truthy, False otherwise.

__contains__

__contains__(key)

Return True if this field was set to something non-zero on the wire.

In most cases, this method will return True when __getattr__ would return a truthy value and False when it would return a falsy value, so explicitly calling this is not useful.

The exception case is empty messages explicitly set on the wire, which are falsy from __getattr__. This method allows to distinguish between an explicitly provided empty message and the absence of that message, which is useful in some edge cases.

The most common edge case is the use of google.protobuf.BoolValue to get a boolean that distinguishes between False and None (or the same for a string, int, etc.). This library transparently handles that case for you, but this method remains available to accommodate cases not automatically covered.

Parameter
NameDescription
key str

The name of the field.

Returns
TypeDescription
boolWhether the field's value corresponds to a non-empty wire serialization.

__delattr__

__delattr__(key)

Delete the value on the given field.

This is generally equivalent to setting a falsy value.

__eq__

__eq__(other)

Return True if the messages are equal, False otherwise.

__getattr__

__getattr__(key)

Retrieve the given field's value.

In protocol buffers, the presence of a field on a message is sufficient for it to always be "present".

For primitives, a value of the correct type will always be returned (the "falsy" values in protocol buffers consistently match those in Python). For repeated fields, the falsy value is always an empty sequence.

For messages, protocol buffers does distinguish between an empty message and absence, but this distinction is subtle and rarely relevant. Therefore, this method always returns an empty message (following the official implementation). To check for message presence, use key in self (in other words, __contains__).

.. note::

Some well-known protocol buffer types
(e.g. ``google.protobuf.Timestamp``) will be converted to
their Python equivalents. See the ``marshal`` module for
more details.

__ne__

__ne__(other)

Return True if the messages are unequal, False otherwise.

__setattr__

__setattr__(key, value)

Set the value on the given field.

For well-known protocol buffer types which are marshalled, either the protocol buffer object or the Python equivalent is accepted.