Class TrainingOptions (3.4.0)

Stay organized with collections Save and categorize content based on your preferences.
TrainingOptions(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Options used in model training.

Attributes

NameDescription
max_iterations int
The maximum number of iterations in training. Used only for iterative training algorithms.
loss_type google.cloud.bigquery_v2.types.Model.LossType
Type of loss function used during training run.
learn_rate float
Learning rate in training. Used only for iterative training algorithms.
l1_regularization google.protobuf.wrappers_pb2.DoubleValue
L1 regularization coefficient.
l2_regularization google.protobuf.wrappers_pb2.DoubleValue
L2 regularization coefficient.
min_relative_progress google.protobuf.wrappers_pb2.DoubleValue
When early_stop is true, stops training when accuracy improvement is less than 'min_relative_progress'. Used only for iterative training algorithms.
warm_start google.protobuf.wrappers_pb2.BoolValue
Whether to train a model from the last checkpoint.
early_stop google.protobuf.wrappers_pb2.BoolValue
Whether to stop early when the loss doesn't improve significantly any more (compared to min_relative_progress). Used only for iterative training algorithms.
input_label_columns Sequence[str]
Name of input label columns in training data.
data_split_method google.cloud.bigquery_v2.types.Model.DataSplitMethod
The data split type for training and evaluation, e.g. RANDOM.
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.
data_split_column str
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
learn_rate_strategy google.cloud.bigquery_v2.types.Model.LearnRateStrategy
The strategy to determine learn rate for the current iteration.
initial_learn_rate float
Specifies the initial learning rate for the line search learn rate strategy.
label_class_weights Mapping[str, float]
Weights associated with each label class, for rebalancing the training data. Only applicable for classification models.
user_column str
User column specified for matrix factorization models.
item_column str
Item column specified for matrix factorization models.
distance_type google.cloud.bigquery_v2.types.Model.DistanceType
Distance type for clustering models.
num_clusters int
Number of clusters for clustering models.
model_uri str
Google Cloud Storage URI from which the model was imported. Only applicable for imported models.
optimization_strategy google.cloud.bigquery_v2.types.Model.OptimizationStrategy
Optimization strategy for training linear regression models.
hidden_units Sequence[int]
Hidden units for dnn models.
batch_size int
Batch size for dnn models.
dropout google.protobuf.wrappers_pb2.DoubleValue
Dropout probability for dnn models.
max_tree_depth int
Maximum depth of a tree for boosted tree models.
subsample float
Subsample fraction of the training data to grow tree to prevent overfitting for boosted tree models.
min_split_loss google.protobuf.wrappers_pb2.DoubleValue
Minimum split loss for boosted tree models.
num_factors int
Num factors specified for matrix factorization models.
feedback_type google.cloud.bigquery_v2.types.Model.FeedbackType
Feedback type that specifies which algorithm to run for matrix factorization.
wals_alpha google.protobuf.wrappers_pb2.DoubleValue
Hyperparameter for matrix factoration when implicit feedback type is specified.
kmeans_initialization_method google.cloud.bigquery_v2.types.Model.KmeansEnums.KmeansInitializationMethod
The method used to initialize the centroids for kmeans algorithm.
kmeans_initialization_column str
The column used to provide the initial centroids for kmeans algorithm when kmeans_initialization_method is CUSTOM.
time_series_timestamp_column str
Column to be designated as time series timestamp for ARIMA model.
time_series_data_column str
Column to be designated as time series data for ARIMA model.
auto_arima bool
Whether to enable auto ARIMA or not.
non_seasonal_order google.cloud.bigquery_v2.types.Model.ArimaOrder
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.
data_frequency google.cloud.bigquery_v2.types.Model.DataFrequency
The data frequency of a time series.
include_drift bool
Include drift when fitting an ARIMA model.
holiday_region google.cloud.bigquery_v2.types.Model.HolidayRegion
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.
time_series_id_column str
The time series id column that was used during ARIMA model training.
time_series_id_columns Sequence[str]
The time series id columns that were used during ARIMA model training.
horizon int
The number of periods ahead that need to be forecasted.
preserve_input_structs bool
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.
auto_arima_max_order int
The max value of non-seasonal p and q.
decompose_time_series google.protobuf.wrappers_pb2.BoolValue
If true, perform decompose time series and save the results.
clean_spikes_and_dips google.protobuf.wrappers_pb2.BoolValue
If true, clean spikes and dips in the input time series.
adjust_step_changes google.protobuf.wrappers_pb2.BoolValue
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)

The abstract base class for a message.

Parameters
NameDescription
kwargs dict

Keys and values corresponding to the fields of the message.

mapping Union[dict, .Message]

A dictionary or message to be used to determine the values for this message.

ignore_unknown_fields Optional(bool)

If True, do not raise errors for unknown fields. Only applied if mapping is a mapping type or there are keyword parameters.

Methods

__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.

__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.