google-cloud-bigquery 3.31.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. google/cloud/bigquery/__init__.py +249 -0
  2. google/cloud/bigquery/_helpers.py +1102 -0
  3. google/cloud/bigquery/_http.py +47 -0
  4. google/cloud/bigquery/_job_helpers.py +600 -0
  5. google/cloud/bigquery/_pandas_helpers.py +1181 -0
  6. google/cloud/bigquery/_pyarrow_helpers.py +147 -0
  7. google/cloud/bigquery/_tqdm_helpers.py +137 -0
  8. google/cloud/bigquery/_versions_helpers.py +264 -0
  9. google/cloud/bigquery/client.py +4406 -0
  10. google/cloud/bigquery/dataset.py +1076 -0
  11. google/cloud/bigquery/dbapi/__init__.py +87 -0
  12. google/cloud/bigquery/dbapi/_helpers.py +522 -0
  13. google/cloud/bigquery/dbapi/connection.py +128 -0
  14. google/cloud/bigquery/dbapi/cursor.py +586 -0
  15. google/cloud/bigquery/dbapi/exceptions.py +58 -0
  16. google/cloud/bigquery/dbapi/types.py +96 -0
  17. google/cloud/bigquery/encryption_configuration.py +84 -0
  18. google/cloud/bigquery/enums.py +389 -0
  19. google/cloud/bigquery/exceptions.py +35 -0
  20. google/cloud/bigquery/external_config.py +1188 -0
  21. google/cloud/bigquery/format_options.py +147 -0
  22. google/cloud/bigquery/iam.py +38 -0
  23. google/cloud/bigquery/job/__init__.py +87 -0
  24. google/cloud/bigquery/job/base.py +1116 -0
  25. google/cloud/bigquery/job/copy_.py +282 -0
  26. google/cloud/bigquery/job/extract.py +271 -0
  27. google/cloud/bigquery/job/load.py +985 -0
  28. google/cloud/bigquery/job/query.py +2498 -0
  29. google/cloud/bigquery/magics/__init__.py +20 -0
  30. google/cloud/bigquery/magics/line_arg_parser/__init__.py +34 -0
  31. google/cloud/bigquery/magics/line_arg_parser/exceptions.py +25 -0
  32. google/cloud/bigquery/magics/line_arg_parser/lexer.py +200 -0
  33. google/cloud/bigquery/magics/line_arg_parser/parser.py +484 -0
  34. google/cloud/bigquery/magics/line_arg_parser/visitors.py +159 -0
  35. google/cloud/bigquery/magics/magics.py +776 -0
  36. google/cloud/bigquery/model.py +517 -0
  37. google/cloud/bigquery/opentelemetry_tracing.py +164 -0
  38. google/cloud/bigquery/py.typed +2 -0
  39. google/cloud/bigquery/query.py +1344 -0
  40. google/cloud/bigquery/retry.py +207 -0
  41. google/cloud/bigquery/routine/__init__.py +33 -0
  42. google/cloud/bigquery/routine/routine.py +744 -0
  43. google/cloud/bigquery/schema.py +896 -0
  44. google/cloud/bigquery/standard_sql.py +389 -0
  45. google/cloud/bigquery/table.py +3594 -0
  46. google/cloud/bigquery/version.py +15 -0
  47. google/cloud/bigquery_v2/__init__.py +56 -0
  48. google/cloud/bigquery_v2/types/__init__.py +54 -0
  49. google/cloud/bigquery_v2/types/encryption_config.py +48 -0
  50. google/cloud/bigquery_v2/types/model.py +1994 -0
  51. google/cloud/bigquery_v2/types/model_reference.py +57 -0
  52. google/cloud/bigquery_v2/types/standard_sql.py +156 -0
  53. google/cloud/bigquery_v2/types/table_reference.py +80 -0
  54. google_cloud_bigquery-3.31.0.dist-info/LICENSE +202 -0
  55. google_cloud_bigquery-3.31.0.dist-info/METADATA +203 -0
  56. google_cloud_bigquery-3.31.0.dist-info/RECORD +58 -0
  57. google_cloud_bigquery-3.31.0.dist-info/WHEEL +5 -0
  58. google_cloud_bigquery-3.31.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1994 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2022 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ import proto # type: ignore
17
+
18
+ from google.cloud.bigquery_v2.types import encryption_config
19
+ from google.cloud.bigquery_v2.types import model_reference as gcb_model_reference
20
+ from google.cloud.bigquery_v2.types import standard_sql
21
+ from google.cloud.bigquery_v2.types import table_reference
22
+ from google.protobuf import timestamp_pb2 # type: ignore
23
+ from google.protobuf import wrappers_pb2 # type: ignore
24
+
25
+
26
+ __protobuf__ = proto.module(
27
+ package="google.cloud.bigquery.v2",
28
+ manifest={
29
+ "Model",
30
+ "GetModelRequest",
31
+ "PatchModelRequest",
32
+ "DeleteModelRequest",
33
+ "ListModelsRequest",
34
+ "ListModelsResponse",
35
+ },
36
+ )
37
+
38
+
39
+ class Model(proto.Message):
40
+ r"""
41
+
42
+ Attributes:
43
+ etag (str):
44
+ Output only. A hash of this resource.
45
+ model_reference (google.cloud.bigquery_v2.types.ModelReference):
46
+ Required. Unique identifier for this model.
47
+ creation_time (int):
48
+ Output only. The time when this model was
49
+ created, in millisecs since the epoch.
50
+ last_modified_time (int):
51
+ Output only. The time when this model was
52
+ last modified, in millisecs since the epoch.
53
+ description (str):
54
+ Optional. A user-friendly description of this
55
+ model.
56
+ friendly_name (str):
57
+ Optional. A descriptive name for this model.
58
+ labels (Mapping[str, str]):
59
+ The labels associated with this model. You
60
+ can use these to organize and group your models.
61
+ Label keys and values can be no longer than 63
62
+ characters, can only contain lowercase letters,
63
+ numeric characters, underscores and dashes.
64
+ International characters are allowed. Label
65
+ values are optional. Label keys must start with
66
+ a letter and each label in the list must have a
67
+ different key.
68
+ expiration_time (int):
69
+ Optional. The time when this model expires,
70
+ in milliseconds since the epoch. If not present,
71
+ the model will persist indefinitely. Expired
72
+ models will be deleted and their storage
73
+ reclaimed. The defaultTableExpirationMs
74
+ property of the encapsulating dataset can be
75
+ used to set a default expirationTime on newly
76
+ created models.
77
+ location (str):
78
+ Output only. The geographic location where
79
+ the model resides. This value is inherited from
80
+ the dataset.
81
+ encryption_configuration (google.cloud.bigquery_v2.types.EncryptionConfiguration):
82
+ Custom encryption configuration (e.g., Cloud
83
+ KMS keys). This shows the encryption
84
+ configuration of the model data while stored in
85
+ BigQuery storage. This field can be used with
86
+ PatchModel to update encryption key for an
87
+ already encrypted model.
88
+ model_type (google.cloud.bigquery_v2.types.Model.ModelType):
89
+ Output only. Type of the model resource.
90
+ training_runs (Sequence[google.cloud.bigquery_v2.types.Model.TrainingRun]):
91
+ Output only. Information for all training runs in increasing
92
+ order of start_time.
93
+ feature_columns (Sequence[google.cloud.bigquery_v2.types.StandardSqlField]):
94
+ Output only. Input feature columns that were
95
+ used to train this model.
96
+ label_columns (Sequence[google.cloud.bigquery_v2.types.StandardSqlField]):
97
+ Output only. Label columns that were used to train this
98
+ model. The output of the model will have a `predicted_`
99
+ prefix to these columns.
100
+ best_trial_id (int):
101
+ The best trial_id across all training runs.
102
+ """
103
+
104
+ class ModelType(proto.Enum):
105
+ r"""Indicates the type of the Model."""
106
+ MODEL_TYPE_UNSPECIFIED = 0
107
+ LINEAR_REGRESSION = 1
108
+ LOGISTIC_REGRESSION = 2
109
+ KMEANS = 3
110
+ MATRIX_FACTORIZATION = 4
111
+ DNN_CLASSIFIER = 5
112
+ TENSORFLOW = 6
113
+ DNN_REGRESSOR = 7
114
+ BOOSTED_TREE_REGRESSOR = 9
115
+ BOOSTED_TREE_CLASSIFIER = 10
116
+ ARIMA = 11
117
+ AUTOML_REGRESSOR = 12
118
+ AUTOML_CLASSIFIER = 13
119
+ ARIMA_PLUS = 19
120
+
121
+ class LossType(proto.Enum):
122
+ r"""Loss metric to evaluate model training performance."""
123
+ LOSS_TYPE_UNSPECIFIED = 0
124
+ MEAN_SQUARED_LOSS = 1
125
+ MEAN_LOG_LOSS = 2
126
+
127
+ class DistanceType(proto.Enum):
128
+ r"""Distance metric used to compute the distance between two
129
+ points.
130
+ """
131
+ DISTANCE_TYPE_UNSPECIFIED = 0
132
+ EUCLIDEAN = 1
133
+ COSINE = 2
134
+
135
+ class DataSplitMethod(proto.Enum):
136
+ r"""Indicates the method to split input data into multiple
137
+ tables.
138
+ """
139
+ DATA_SPLIT_METHOD_UNSPECIFIED = 0
140
+ RANDOM = 1
141
+ CUSTOM = 2
142
+ SEQUENTIAL = 3
143
+ NO_SPLIT = 4
144
+ AUTO_SPLIT = 5
145
+
146
+ class DataFrequency(proto.Enum):
147
+ r"""Type of supported data frequency for time series forecasting
148
+ models.
149
+ """
150
+ DATA_FREQUENCY_UNSPECIFIED = 0
151
+ AUTO_FREQUENCY = 1
152
+ YEARLY = 2
153
+ QUARTERLY = 3
154
+ MONTHLY = 4
155
+ WEEKLY = 5
156
+ DAILY = 6
157
+ HOURLY = 7
158
+ PER_MINUTE = 8
159
+
160
+ class HolidayRegion(proto.Enum):
161
+ r"""Type of supported holiday regions for time series forecasting
162
+ models.
163
+ """
164
+ HOLIDAY_REGION_UNSPECIFIED = 0
165
+ GLOBAL = 1
166
+ NA = 2
167
+ JAPAC = 3
168
+ EMEA = 4
169
+ LAC = 5
170
+ AE = 6
171
+ AR = 7
172
+ AT = 8
173
+ AU = 9
174
+ BE = 10
175
+ BR = 11
176
+ CA = 12
177
+ CH = 13
178
+ CL = 14
179
+ CN = 15
180
+ CO = 16
181
+ CS = 17
182
+ CZ = 18
183
+ DE = 19
184
+ DK = 20
185
+ DZ = 21
186
+ EC = 22
187
+ EE = 23
188
+ EG = 24
189
+ ES = 25
190
+ FI = 26
191
+ FR = 27
192
+ GB = 28
193
+ GR = 29
194
+ HK = 30
195
+ HU = 31
196
+ ID = 32
197
+ IE = 33
198
+ IL = 34
199
+ IN = 35
200
+ IR = 36
201
+ IT = 37
202
+ JP = 38
203
+ KR = 39
204
+ LV = 40
205
+ MA = 41
206
+ MX = 42
207
+ MY = 43
208
+ NG = 44
209
+ NL = 45
210
+ NO = 46
211
+ NZ = 47
212
+ PE = 48
213
+ PH = 49
214
+ PK = 50
215
+ PL = 51
216
+ PT = 52
217
+ RO = 53
218
+ RS = 54
219
+ RU = 55
220
+ SA = 56
221
+ SE = 57
222
+ SG = 58
223
+ SI = 59
224
+ SK = 60
225
+ TH = 61
226
+ TR = 62
227
+ TW = 63
228
+ UA = 64
229
+ US = 65
230
+ VE = 66
231
+ VN = 67
232
+ ZA = 68
233
+
234
+ class LearnRateStrategy(proto.Enum):
235
+ r"""Indicates the learning rate optimization strategy to use."""
236
+ LEARN_RATE_STRATEGY_UNSPECIFIED = 0
237
+ LINE_SEARCH = 1
238
+ CONSTANT = 2
239
+
240
+ class OptimizationStrategy(proto.Enum):
241
+ r"""Indicates the optimization strategy used for training."""
242
+ OPTIMIZATION_STRATEGY_UNSPECIFIED = 0
243
+ BATCH_GRADIENT_DESCENT = 1
244
+ NORMAL_EQUATION = 2
245
+
246
+ class FeedbackType(proto.Enum):
247
+ r"""Indicates the training algorithm to use for matrix
248
+ factorization models.
249
+ """
250
+ FEEDBACK_TYPE_UNSPECIFIED = 0
251
+ IMPLICIT = 1
252
+ EXPLICIT = 2
253
+
254
+ class SeasonalPeriod(proto.Message):
255
+ r""" """
256
+
257
+ class SeasonalPeriodType(proto.Enum):
258
+ r""""""
259
+ SEASONAL_PERIOD_TYPE_UNSPECIFIED = 0
260
+ NO_SEASONALITY = 1
261
+ DAILY = 2
262
+ WEEKLY = 3
263
+ MONTHLY = 4
264
+ QUARTERLY = 5
265
+ YEARLY = 6
266
+
267
+ class KmeansEnums(proto.Message):
268
+ r""" """
269
+
270
+ class KmeansInitializationMethod(proto.Enum):
271
+ r"""Indicates the method used to initialize the centroids for
272
+ KMeans clustering algorithm.
273
+ """
274
+ KMEANS_INITIALIZATION_METHOD_UNSPECIFIED = 0
275
+ RANDOM = 1
276
+ CUSTOM = 2
277
+ KMEANS_PLUS_PLUS = 3
278
+
279
+ class RegressionMetrics(proto.Message):
280
+ r"""Evaluation metrics for regression and explicit feedback type
281
+ matrix factorization models.
282
+
283
+ Attributes:
284
+ mean_absolute_error (google.protobuf.wrappers_pb2.DoubleValue):
285
+ Mean absolute error.
286
+ mean_squared_error (google.protobuf.wrappers_pb2.DoubleValue):
287
+ Mean squared error.
288
+ mean_squared_log_error (google.protobuf.wrappers_pb2.DoubleValue):
289
+ Mean squared log error.
290
+ median_absolute_error (google.protobuf.wrappers_pb2.DoubleValue):
291
+ Median absolute error.
292
+ r_squared (google.protobuf.wrappers_pb2.DoubleValue):
293
+ R^2 score. This corresponds to r2_score in ML.EVALUATE.
294
+ """
295
+
296
+ mean_absolute_error = proto.Field(
297
+ proto.MESSAGE,
298
+ number=1,
299
+ message=wrappers_pb2.DoubleValue,
300
+ )
301
+ mean_squared_error = proto.Field(
302
+ proto.MESSAGE,
303
+ number=2,
304
+ message=wrappers_pb2.DoubleValue,
305
+ )
306
+ mean_squared_log_error = proto.Field(
307
+ proto.MESSAGE,
308
+ number=3,
309
+ message=wrappers_pb2.DoubleValue,
310
+ )
311
+ median_absolute_error = proto.Field(
312
+ proto.MESSAGE,
313
+ number=4,
314
+ message=wrappers_pb2.DoubleValue,
315
+ )
316
+ r_squared = proto.Field(
317
+ proto.MESSAGE,
318
+ number=5,
319
+ message=wrappers_pb2.DoubleValue,
320
+ )
321
+
322
+ class AggregateClassificationMetrics(proto.Message):
323
+ r"""Aggregate metrics for classification/classifier models. For
324
+ multi-class models, the metrics are either macro-averaged or
325
+ micro-averaged. When macro-averaged, the metrics are calculated
326
+ for each label and then an unweighted average is taken of those
327
+ values. When micro-averaged, the metric is calculated globally
328
+ by counting the total number of correctly predicted rows.
329
+
330
+ Attributes:
331
+ precision (google.protobuf.wrappers_pb2.DoubleValue):
332
+ Precision is the fraction of actual positive
333
+ predictions that had positive actual labels. For
334
+ multiclass this is a macro-averaged metric
335
+ treating each class as a binary classifier.
336
+ recall (google.protobuf.wrappers_pb2.DoubleValue):
337
+ Recall is the fraction of actual positive
338
+ labels that were given a positive prediction.
339
+ For multiclass this is a macro-averaged metric.
340
+ accuracy (google.protobuf.wrappers_pb2.DoubleValue):
341
+ Accuracy is the fraction of predictions given
342
+ the correct label. For multiclass this is a
343
+ micro-averaged metric.
344
+ threshold (google.protobuf.wrappers_pb2.DoubleValue):
345
+ Threshold at which the metrics are computed.
346
+ For binary classification models this is the
347
+ positive class threshold. For multi-class
348
+ classfication models this is the confidence
349
+ threshold.
350
+ f1_score (google.protobuf.wrappers_pb2.DoubleValue):
351
+ The F1 score is an average of recall and
352
+ precision. For multiclass this is a
353
+ macro-averaged metric.
354
+ log_loss (google.protobuf.wrappers_pb2.DoubleValue):
355
+ Logarithmic Loss. For multiclass this is a
356
+ macro-averaged metric.
357
+ roc_auc (google.protobuf.wrappers_pb2.DoubleValue):
358
+ Area Under a ROC Curve. For multiclass this
359
+ is a macro-averaged metric.
360
+ """
361
+
362
+ precision = proto.Field(
363
+ proto.MESSAGE,
364
+ number=1,
365
+ message=wrappers_pb2.DoubleValue,
366
+ )
367
+ recall = proto.Field(
368
+ proto.MESSAGE,
369
+ number=2,
370
+ message=wrappers_pb2.DoubleValue,
371
+ )
372
+ accuracy = proto.Field(
373
+ proto.MESSAGE,
374
+ number=3,
375
+ message=wrappers_pb2.DoubleValue,
376
+ )
377
+ threshold = proto.Field(
378
+ proto.MESSAGE,
379
+ number=4,
380
+ message=wrappers_pb2.DoubleValue,
381
+ )
382
+ f1_score = proto.Field(
383
+ proto.MESSAGE,
384
+ number=5,
385
+ message=wrappers_pb2.DoubleValue,
386
+ )
387
+ log_loss = proto.Field(
388
+ proto.MESSAGE,
389
+ number=6,
390
+ message=wrappers_pb2.DoubleValue,
391
+ )
392
+ roc_auc = proto.Field(
393
+ proto.MESSAGE,
394
+ number=7,
395
+ message=wrappers_pb2.DoubleValue,
396
+ )
397
+
398
+ class BinaryClassificationMetrics(proto.Message):
399
+ r"""Evaluation metrics for binary classification/classifier
400
+ models.
401
+
402
+ Attributes:
403
+ aggregate_classification_metrics (google.cloud.bigquery_v2.types.Model.AggregateClassificationMetrics):
404
+ Aggregate classification metrics.
405
+ binary_confusion_matrix_list (Sequence[google.cloud.bigquery_v2.types.Model.BinaryClassificationMetrics.BinaryConfusionMatrix]):
406
+ Binary confusion matrix at multiple
407
+ thresholds.
408
+ positive_label (str):
409
+ Label representing the positive class.
410
+ negative_label (str):
411
+ Label representing the negative class.
412
+ """
413
+
414
+ class BinaryConfusionMatrix(proto.Message):
415
+ r"""Confusion matrix for binary classification models.
416
+
417
+ Attributes:
418
+ positive_class_threshold (google.protobuf.wrappers_pb2.DoubleValue):
419
+ Threshold value used when computing each of
420
+ the following metric.
421
+ true_positives (google.protobuf.wrappers_pb2.Int64Value):
422
+ Number of true samples predicted as true.
423
+ false_positives (google.protobuf.wrappers_pb2.Int64Value):
424
+ Number of false samples predicted as true.
425
+ true_negatives (google.protobuf.wrappers_pb2.Int64Value):
426
+ Number of true samples predicted as false.
427
+ false_negatives (google.protobuf.wrappers_pb2.Int64Value):
428
+ Number of false samples predicted as false.
429
+ precision (google.protobuf.wrappers_pb2.DoubleValue):
430
+ The fraction of actual positive predictions
431
+ that had positive actual labels.
432
+ recall (google.protobuf.wrappers_pb2.DoubleValue):
433
+ The fraction of actual positive labels that
434
+ were given a positive prediction.
435
+ f1_score (google.protobuf.wrappers_pb2.DoubleValue):
436
+ The equally weighted average of recall and
437
+ precision.
438
+ accuracy (google.protobuf.wrappers_pb2.DoubleValue):
439
+ The fraction of predictions given the correct
440
+ label.
441
+ """
442
+
443
+ positive_class_threshold = proto.Field(
444
+ proto.MESSAGE,
445
+ number=1,
446
+ message=wrappers_pb2.DoubleValue,
447
+ )
448
+ true_positives = proto.Field(
449
+ proto.MESSAGE,
450
+ number=2,
451
+ message=wrappers_pb2.Int64Value,
452
+ )
453
+ false_positives = proto.Field(
454
+ proto.MESSAGE,
455
+ number=3,
456
+ message=wrappers_pb2.Int64Value,
457
+ )
458
+ true_negatives = proto.Field(
459
+ proto.MESSAGE,
460
+ number=4,
461
+ message=wrappers_pb2.Int64Value,
462
+ )
463
+ false_negatives = proto.Field(
464
+ proto.MESSAGE,
465
+ number=5,
466
+ message=wrappers_pb2.Int64Value,
467
+ )
468
+ precision = proto.Field(
469
+ proto.MESSAGE,
470
+ number=6,
471
+ message=wrappers_pb2.DoubleValue,
472
+ )
473
+ recall = proto.Field(
474
+ proto.MESSAGE,
475
+ number=7,
476
+ message=wrappers_pb2.DoubleValue,
477
+ )
478
+ f1_score = proto.Field(
479
+ proto.MESSAGE,
480
+ number=8,
481
+ message=wrappers_pb2.DoubleValue,
482
+ )
483
+ accuracy = proto.Field(
484
+ proto.MESSAGE,
485
+ number=9,
486
+ message=wrappers_pb2.DoubleValue,
487
+ )
488
+
489
+ aggregate_classification_metrics = proto.Field(
490
+ proto.MESSAGE,
491
+ number=1,
492
+ message="Model.AggregateClassificationMetrics",
493
+ )
494
+ binary_confusion_matrix_list = proto.RepeatedField(
495
+ proto.MESSAGE,
496
+ number=2,
497
+ message="Model.BinaryClassificationMetrics.BinaryConfusionMatrix",
498
+ )
499
+ positive_label = proto.Field(
500
+ proto.STRING,
501
+ number=3,
502
+ )
503
+ negative_label = proto.Field(
504
+ proto.STRING,
505
+ number=4,
506
+ )
507
+
508
+ class MultiClassClassificationMetrics(proto.Message):
509
+ r"""Evaluation metrics for multi-class classification/classifier
510
+ models.
511
+
512
+ Attributes:
513
+ aggregate_classification_metrics (google.cloud.bigquery_v2.types.Model.AggregateClassificationMetrics):
514
+ Aggregate classification metrics.
515
+ confusion_matrix_list (Sequence[google.cloud.bigquery_v2.types.Model.MultiClassClassificationMetrics.ConfusionMatrix]):
516
+ Confusion matrix at different thresholds.
517
+ """
518
+
519
+ class ConfusionMatrix(proto.Message):
520
+ r"""Confusion matrix for multi-class classification models.
521
+
522
+ Attributes:
523
+ confidence_threshold (google.protobuf.wrappers_pb2.DoubleValue):
524
+ Confidence threshold used when computing the
525
+ entries of the confusion matrix.
526
+ rows (Sequence[google.cloud.bigquery_v2.types.Model.MultiClassClassificationMetrics.ConfusionMatrix.Row]):
527
+ One row per actual label.
528
+ """
529
+
530
+ class Entry(proto.Message):
531
+ r"""A single entry in the confusion matrix.
532
+
533
+ Attributes:
534
+ predicted_label (str):
535
+ The predicted label. For confidence_threshold > 0, we will
536
+ also add an entry indicating the number of items under the
537
+ confidence threshold.
538
+ item_count (google.protobuf.wrappers_pb2.Int64Value):
539
+ Number of items being predicted as this
540
+ label.
541
+ """
542
+
543
+ predicted_label = proto.Field(
544
+ proto.STRING,
545
+ number=1,
546
+ )
547
+ item_count = proto.Field(
548
+ proto.MESSAGE,
549
+ number=2,
550
+ message=wrappers_pb2.Int64Value,
551
+ )
552
+
553
+ class Row(proto.Message):
554
+ r"""A single row in the confusion matrix.
555
+
556
+ Attributes:
557
+ actual_label (str):
558
+ The original label of this row.
559
+ entries (Sequence[google.cloud.bigquery_v2.types.Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry]):
560
+ Info describing predicted label distribution.
561
+ """
562
+
563
+ actual_label = proto.Field(
564
+ proto.STRING,
565
+ number=1,
566
+ )
567
+ entries = proto.RepeatedField(
568
+ proto.MESSAGE,
569
+ number=2,
570
+ message="Model.MultiClassClassificationMetrics.ConfusionMatrix.Entry",
571
+ )
572
+
573
+ confidence_threshold = proto.Field(
574
+ proto.MESSAGE,
575
+ number=1,
576
+ message=wrappers_pb2.DoubleValue,
577
+ )
578
+ rows = proto.RepeatedField(
579
+ proto.MESSAGE,
580
+ number=2,
581
+ message="Model.MultiClassClassificationMetrics.ConfusionMatrix.Row",
582
+ )
583
+
584
+ aggregate_classification_metrics = proto.Field(
585
+ proto.MESSAGE,
586
+ number=1,
587
+ message="Model.AggregateClassificationMetrics",
588
+ )
589
+ confusion_matrix_list = proto.RepeatedField(
590
+ proto.MESSAGE,
591
+ number=2,
592
+ message="Model.MultiClassClassificationMetrics.ConfusionMatrix",
593
+ )
594
+
595
+ class ClusteringMetrics(proto.Message):
596
+ r"""Evaluation metrics for clustering models.
597
+
598
+ Attributes:
599
+ davies_bouldin_index (google.protobuf.wrappers_pb2.DoubleValue):
600
+ Davies-Bouldin index.
601
+ mean_squared_distance (google.protobuf.wrappers_pb2.DoubleValue):
602
+ Mean of squared distances between each sample
603
+ to its cluster centroid.
604
+ clusters (Sequence[google.cloud.bigquery_v2.types.Model.ClusteringMetrics.Cluster]):
605
+ Information for all clusters.
606
+ """
607
+
608
+ class Cluster(proto.Message):
609
+ r"""Message containing the information about one cluster.
610
+
611
+ Attributes:
612
+ centroid_id (int):
613
+ Centroid id.
614
+ feature_values (Sequence[google.cloud.bigquery_v2.types.Model.ClusteringMetrics.Cluster.FeatureValue]):
615
+ Values of highly variant features for this
616
+ cluster.
617
+ count (google.protobuf.wrappers_pb2.Int64Value):
618
+ Count of training data rows that were
619
+ assigned to this cluster.
620
+ """
621
+
622
+ class FeatureValue(proto.Message):
623
+ r"""Representative value of a single feature within the cluster.
624
+
625
+ This message has `oneof`_ fields (mutually exclusive fields).
626
+ For each oneof, at most one member field can be set at the same time.
627
+ Setting any member of the oneof automatically clears all other
628
+ members.
629
+
630
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
631
+
632
+ Attributes:
633
+ feature_column (str):
634
+ The feature column name.
635
+ numerical_value (google.protobuf.wrappers_pb2.DoubleValue):
636
+ The numerical feature value. This is the
637
+ centroid value for this feature.
638
+
639
+ This field is a member of `oneof`_ ``value``.
640
+ categorical_value (google.cloud.bigquery_v2.types.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue):
641
+ The categorical feature value.
642
+
643
+ This field is a member of `oneof`_ ``value``.
644
+ """
645
+
646
+ class CategoricalValue(proto.Message):
647
+ r"""Representative value of a categorical feature.
648
+
649
+ Attributes:
650
+ category_counts (Sequence[google.cloud.bigquery_v2.types.Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount]):
651
+ Counts of all categories for the categorical feature. If
652
+ there are more than ten categories, we return top ten (by
653
+ count) and return one more CategoryCount with category
654
+ "*OTHER*" and count as aggregate counts of remaining
655
+ categories.
656
+ """
657
+
658
+ class CategoryCount(proto.Message):
659
+ r"""Represents the count of a single category within the cluster.
660
+
661
+ Attributes:
662
+ category (str):
663
+ The name of category.
664
+ count (google.protobuf.wrappers_pb2.Int64Value):
665
+ The count of training samples matching the
666
+ category within the cluster.
667
+ """
668
+
669
+ category = proto.Field(
670
+ proto.STRING,
671
+ number=1,
672
+ )
673
+ count = proto.Field(
674
+ proto.MESSAGE,
675
+ number=2,
676
+ message=wrappers_pb2.Int64Value,
677
+ )
678
+
679
+ category_counts = proto.RepeatedField(
680
+ proto.MESSAGE,
681
+ number=1,
682
+ message="Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue.CategoryCount",
683
+ )
684
+
685
+ feature_column = proto.Field(
686
+ proto.STRING,
687
+ number=1,
688
+ )
689
+ numerical_value = proto.Field(
690
+ proto.MESSAGE,
691
+ number=2,
692
+ oneof="value",
693
+ message=wrappers_pb2.DoubleValue,
694
+ )
695
+ categorical_value = proto.Field(
696
+ proto.MESSAGE,
697
+ number=3,
698
+ oneof="value",
699
+ message="Model.ClusteringMetrics.Cluster.FeatureValue.CategoricalValue",
700
+ )
701
+
702
+ centroid_id = proto.Field(
703
+ proto.INT64,
704
+ number=1,
705
+ )
706
+ feature_values = proto.RepeatedField(
707
+ proto.MESSAGE,
708
+ number=2,
709
+ message="Model.ClusteringMetrics.Cluster.FeatureValue",
710
+ )
711
+ count = proto.Field(
712
+ proto.MESSAGE,
713
+ number=3,
714
+ message=wrappers_pb2.Int64Value,
715
+ )
716
+
717
+ davies_bouldin_index = proto.Field(
718
+ proto.MESSAGE,
719
+ number=1,
720
+ message=wrappers_pb2.DoubleValue,
721
+ )
722
+ mean_squared_distance = proto.Field(
723
+ proto.MESSAGE,
724
+ number=2,
725
+ message=wrappers_pb2.DoubleValue,
726
+ )
727
+ clusters = proto.RepeatedField(
728
+ proto.MESSAGE,
729
+ number=3,
730
+ message="Model.ClusteringMetrics.Cluster",
731
+ )
732
+
733
+ class RankingMetrics(proto.Message):
734
+ r"""Evaluation metrics used by weighted-ALS models specified by
735
+ feedback_type=implicit.
736
+
737
+ Attributes:
738
+ mean_average_precision (google.protobuf.wrappers_pb2.DoubleValue):
739
+ Calculates a precision per user for all the
740
+ items by ranking them and then averages all the
741
+ precisions across all the users.
742
+ mean_squared_error (google.protobuf.wrappers_pb2.DoubleValue):
743
+ Similar to the mean squared error computed in
744
+ regression and explicit recommendation models
745
+ except instead of computing the rating directly,
746
+ the output from evaluate is computed against a
747
+ preference which is 1 or 0 depending on if the
748
+ rating exists or not.
749
+ normalized_discounted_cumulative_gain (google.protobuf.wrappers_pb2.DoubleValue):
750
+ A metric to determine the goodness of a
751
+ ranking calculated from the predicted confidence
752
+ by comparing it to an ideal rank measured by the
753
+ original ratings.
754
+ average_rank (google.protobuf.wrappers_pb2.DoubleValue):
755
+ Determines the goodness of a ranking by
756
+ computing the percentile rank from the predicted
757
+ confidence and dividing it by the original rank.
758
+ """
759
+
760
+ mean_average_precision = proto.Field(
761
+ proto.MESSAGE,
762
+ number=1,
763
+ message=wrappers_pb2.DoubleValue,
764
+ )
765
+ mean_squared_error = proto.Field(
766
+ proto.MESSAGE,
767
+ number=2,
768
+ message=wrappers_pb2.DoubleValue,
769
+ )
770
+ normalized_discounted_cumulative_gain = proto.Field(
771
+ proto.MESSAGE,
772
+ number=3,
773
+ message=wrappers_pb2.DoubleValue,
774
+ )
775
+ average_rank = proto.Field(
776
+ proto.MESSAGE,
777
+ number=4,
778
+ message=wrappers_pb2.DoubleValue,
779
+ )
780
+
781
+ class ArimaForecastingMetrics(proto.Message):
782
+ r"""Model evaluation metrics for ARIMA forecasting models.
783
+
784
+ Attributes:
785
+ non_seasonal_order (Sequence[google.cloud.bigquery_v2.types.Model.ArimaOrder]):
786
+ Non-seasonal order.
787
+ arima_fitting_metrics (Sequence[google.cloud.bigquery_v2.types.Model.ArimaFittingMetrics]):
788
+ Arima model fitting metrics.
789
+ seasonal_periods (Sequence[google.cloud.bigquery_v2.types.Model.SeasonalPeriod.SeasonalPeriodType]):
790
+ Seasonal periods. Repeated because multiple
791
+ periods are supported for one time series.
792
+ has_drift (Sequence[bool]):
793
+ Whether Arima model fitted with drift or not.
794
+ It is always false when d is not 1.
795
+ time_series_id (Sequence[str]):
796
+ Id to differentiate different time series for
797
+ the large-scale case.
798
+ arima_single_model_forecasting_metrics (Sequence[google.cloud.bigquery_v2.types.Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics]):
799
+ Repeated as there can be many metric sets
800
+ (one for each model) in auto-arima and the
801
+ large-scale case.
802
+ """
803
+
804
+ class ArimaSingleModelForecastingMetrics(proto.Message):
805
+ r"""Model evaluation metrics for a single ARIMA forecasting
806
+ model.
807
+
808
+ Attributes:
809
+ non_seasonal_order (google.cloud.bigquery_v2.types.Model.ArimaOrder):
810
+ Non-seasonal order.
811
+ arima_fitting_metrics (google.cloud.bigquery_v2.types.Model.ArimaFittingMetrics):
812
+ Arima fitting metrics.
813
+ has_drift (bool):
814
+ Is arima model fitted with drift or not. It
815
+ is always false when d is not 1.
816
+ time_series_id (str):
817
+ The time_series_id value for this time series. It will be
818
+ one of the unique values from the time_series_id_column
819
+ specified during ARIMA model training. Only present when
820
+ time_series_id_column training option was used.
821
+ time_series_ids (Sequence[str]):
822
+ The tuple of time_series_ids identifying this time series.
823
+ It will be one of the unique tuples of values present in the
824
+ time_series_id_columns specified during ARIMA model
825
+ training. Only present when time_series_id_columns training
826
+ option was used and the order of values here are same as the
827
+ order of time_series_id_columns.
828
+ seasonal_periods (Sequence[google.cloud.bigquery_v2.types.Model.SeasonalPeriod.SeasonalPeriodType]):
829
+ Seasonal periods. Repeated because multiple
830
+ periods are supported for one time series.
831
+ has_holiday_effect (google.protobuf.wrappers_pb2.BoolValue):
832
+ If true, holiday_effect is a part of time series
833
+ decomposition result.
834
+ has_spikes_and_dips (google.protobuf.wrappers_pb2.BoolValue):
835
+ If true, spikes_and_dips is a part of time series
836
+ decomposition result.
837
+ has_step_changes (google.protobuf.wrappers_pb2.BoolValue):
838
+ If true, step_changes is a part of time series decomposition
839
+ result.
840
+ """
841
+
842
+ non_seasonal_order = proto.Field(
843
+ proto.MESSAGE,
844
+ number=1,
845
+ message="Model.ArimaOrder",
846
+ )
847
+ arima_fitting_metrics = proto.Field(
848
+ proto.MESSAGE,
849
+ number=2,
850
+ message="Model.ArimaFittingMetrics",
851
+ )
852
+ has_drift = proto.Field(
853
+ proto.BOOL,
854
+ number=3,
855
+ )
856
+ time_series_id = proto.Field(
857
+ proto.STRING,
858
+ number=4,
859
+ )
860
+ time_series_ids = proto.RepeatedField(
861
+ proto.STRING,
862
+ number=9,
863
+ )
864
+ seasonal_periods = proto.RepeatedField(
865
+ proto.ENUM,
866
+ number=5,
867
+ enum="Model.SeasonalPeriod.SeasonalPeriodType",
868
+ )
869
+ has_holiday_effect = proto.Field(
870
+ proto.MESSAGE,
871
+ number=6,
872
+ message=wrappers_pb2.BoolValue,
873
+ )
874
+ has_spikes_and_dips = proto.Field(
875
+ proto.MESSAGE,
876
+ number=7,
877
+ message=wrappers_pb2.BoolValue,
878
+ )
879
+ has_step_changes = proto.Field(
880
+ proto.MESSAGE,
881
+ number=8,
882
+ message=wrappers_pb2.BoolValue,
883
+ )
884
+
885
+ non_seasonal_order = proto.RepeatedField(
886
+ proto.MESSAGE,
887
+ number=1,
888
+ message="Model.ArimaOrder",
889
+ )
890
+ arima_fitting_metrics = proto.RepeatedField(
891
+ proto.MESSAGE,
892
+ number=2,
893
+ message="Model.ArimaFittingMetrics",
894
+ )
895
+ seasonal_periods = proto.RepeatedField(
896
+ proto.ENUM,
897
+ number=3,
898
+ enum="Model.SeasonalPeriod.SeasonalPeriodType",
899
+ )
900
+ has_drift = proto.RepeatedField(
901
+ proto.BOOL,
902
+ number=4,
903
+ )
904
+ time_series_id = proto.RepeatedField(
905
+ proto.STRING,
906
+ number=5,
907
+ )
908
+ arima_single_model_forecasting_metrics = proto.RepeatedField(
909
+ proto.MESSAGE,
910
+ number=6,
911
+ message="Model.ArimaForecastingMetrics.ArimaSingleModelForecastingMetrics",
912
+ )
913
+
914
+ class EvaluationMetrics(proto.Message):
915
+ r"""Evaluation metrics of a model. These are either computed on
916
+ all training data or just the eval data based on whether eval
917
+ data was used during training. These are not present for
918
+ imported models.
919
+
920
+ This message has `oneof`_ fields (mutually exclusive fields).
921
+ For each oneof, at most one member field can be set at the same time.
922
+ Setting any member of the oneof automatically clears all other
923
+ members.
924
+
925
+ .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
926
+
927
+ Attributes:
928
+ regression_metrics (google.cloud.bigquery_v2.types.Model.RegressionMetrics):
929
+ Populated for regression models and explicit
930
+ feedback type matrix factorization models.
931
+
932
+ This field is a member of `oneof`_ ``metrics``.
933
+ binary_classification_metrics (google.cloud.bigquery_v2.types.Model.BinaryClassificationMetrics):
934
+ Populated for binary
935
+ classification/classifier models.
936
+
937
+ This field is a member of `oneof`_ ``metrics``.
938
+ multi_class_classification_metrics (google.cloud.bigquery_v2.types.Model.MultiClassClassificationMetrics):
939
+ Populated for multi-class
940
+ classification/classifier models.
941
+
942
+ This field is a member of `oneof`_ ``metrics``.
943
+ clustering_metrics (google.cloud.bigquery_v2.types.Model.ClusteringMetrics):
944
+ Populated for clustering models.
945
+
946
+ This field is a member of `oneof`_ ``metrics``.
947
+ ranking_metrics (google.cloud.bigquery_v2.types.Model.RankingMetrics):
948
+ Populated for implicit feedback type matrix
949
+ factorization models.
950
+
951
+ This field is a member of `oneof`_ ``metrics``.
952
+ arima_forecasting_metrics (google.cloud.bigquery_v2.types.Model.ArimaForecastingMetrics):
953
+ Populated for ARIMA models.
954
+
955
+ This field is a member of `oneof`_ ``metrics``.
956
+ """
957
+
958
+ regression_metrics = proto.Field(
959
+ proto.MESSAGE,
960
+ number=1,
961
+ oneof="metrics",
962
+ message="Model.RegressionMetrics",
963
+ )
964
+ binary_classification_metrics = proto.Field(
965
+ proto.MESSAGE,
966
+ number=2,
967
+ oneof="metrics",
968
+ message="Model.BinaryClassificationMetrics",
969
+ )
970
+ multi_class_classification_metrics = proto.Field(
971
+ proto.MESSAGE,
972
+ number=3,
973
+ oneof="metrics",
974
+ message="Model.MultiClassClassificationMetrics",
975
+ )
976
+ clustering_metrics = proto.Field(
977
+ proto.MESSAGE,
978
+ number=4,
979
+ oneof="metrics",
980
+ message="Model.ClusteringMetrics",
981
+ )
982
+ ranking_metrics = proto.Field(
983
+ proto.MESSAGE,
984
+ number=5,
985
+ oneof="metrics",
986
+ message="Model.RankingMetrics",
987
+ )
988
+ arima_forecasting_metrics = proto.Field(
989
+ proto.MESSAGE,
990
+ number=6,
991
+ oneof="metrics",
992
+ message="Model.ArimaForecastingMetrics",
993
+ )
994
+
995
+ class DataSplitResult(proto.Message):
996
+ r"""Data split result. This contains references to the training
997
+ and evaluation data tables that were used to train the model.
998
+
999
+ Attributes:
1000
+ training_table (google.cloud.bigquery_v2.types.TableReference):
1001
+ Table reference of the training data after
1002
+ split.
1003
+ evaluation_table (google.cloud.bigquery_v2.types.TableReference):
1004
+ Table reference of the evaluation data after
1005
+ split.
1006
+ """
1007
+
1008
+ training_table = proto.Field(
1009
+ proto.MESSAGE,
1010
+ number=1,
1011
+ message=table_reference.TableReference,
1012
+ )
1013
+ evaluation_table = proto.Field(
1014
+ proto.MESSAGE,
1015
+ number=2,
1016
+ message=table_reference.TableReference,
1017
+ )
1018
+
1019
+ class ArimaOrder(proto.Message):
1020
+ r"""Arima order, can be used for both non-seasonal and seasonal
1021
+ parts.
1022
+
1023
+ Attributes:
1024
+ p (int):
1025
+ Order of the autoregressive part.
1026
+ d (int):
1027
+ Order of the differencing part.
1028
+ q (int):
1029
+ Order of the moving-average part.
1030
+ """
1031
+
1032
+ p = proto.Field(
1033
+ proto.INT64,
1034
+ number=1,
1035
+ )
1036
+ d = proto.Field(
1037
+ proto.INT64,
1038
+ number=2,
1039
+ )
1040
+ q = proto.Field(
1041
+ proto.INT64,
1042
+ number=3,
1043
+ )
1044
+
1045
+ class ArimaFittingMetrics(proto.Message):
1046
+ r"""ARIMA model fitting metrics.
1047
+
1048
+ Attributes:
1049
+ log_likelihood (float):
1050
+ Log-likelihood.
1051
+ aic (float):
1052
+ AIC.
1053
+ variance (float):
1054
+ Variance.
1055
+ """
1056
+
1057
+ log_likelihood = proto.Field(
1058
+ proto.DOUBLE,
1059
+ number=1,
1060
+ )
1061
+ aic = proto.Field(
1062
+ proto.DOUBLE,
1063
+ number=2,
1064
+ )
1065
+ variance = proto.Field(
1066
+ proto.DOUBLE,
1067
+ number=3,
1068
+ )
1069
+
1070
+ class GlobalExplanation(proto.Message):
1071
+ r"""Global explanations containing the top most important
1072
+ features after training.
1073
+
1074
+ Attributes:
1075
+ explanations (Sequence[google.cloud.bigquery_v2.types.Model.GlobalExplanation.Explanation]):
1076
+ A list of the top global explanations. Sorted
1077
+ by absolute value of attribution in descending
1078
+ order.
1079
+ class_label (str):
1080
+ Class label for this set of global
1081
+ explanations. Will be empty/null for binary
1082
+ logistic and linear regression models. Sorted
1083
+ alphabetically in descending order.
1084
+ """
1085
+
1086
+ class Explanation(proto.Message):
1087
+ r"""Explanation for a single feature.
1088
+
1089
+ Attributes:
1090
+ feature_name (str):
1091
+ Full name of the feature. For non-numerical features, will
1092
+ be formatted like <column_name>.<encoded_feature_name>.
1093
+ Overall size of feature name will always be truncated to
1094
+ first 120 characters.
1095
+ attribution (google.protobuf.wrappers_pb2.DoubleValue):
1096
+ Attribution of feature.
1097
+ """
1098
+
1099
+ feature_name = proto.Field(
1100
+ proto.STRING,
1101
+ number=1,
1102
+ )
1103
+ attribution = proto.Field(
1104
+ proto.MESSAGE,
1105
+ number=2,
1106
+ message=wrappers_pb2.DoubleValue,
1107
+ )
1108
+
1109
+ explanations = proto.RepeatedField(
1110
+ proto.MESSAGE,
1111
+ number=1,
1112
+ message="Model.GlobalExplanation.Explanation",
1113
+ )
1114
+ class_label = proto.Field(
1115
+ proto.STRING,
1116
+ number=2,
1117
+ )
1118
+
1119
+ class TrainingRun(proto.Message):
1120
+ r"""Information about a single training query run for the model.
1121
+
1122
+ Attributes:
1123
+ training_options (google.cloud.bigquery_v2.types.Model.TrainingRun.TrainingOptions):
1124
+ Options that were used for this training run,
1125
+ includes user specified and default options that
1126
+ were used.
1127
+ start_time (google.protobuf.timestamp_pb2.Timestamp):
1128
+ The start time of this training run.
1129
+ results (Sequence[google.cloud.bigquery_v2.types.Model.TrainingRun.IterationResult]):
1130
+ Output of each iteration run, results.size() <=
1131
+ max_iterations.
1132
+ evaluation_metrics (google.cloud.bigquery_v2.types.Model.EvaluationMetrics):
1133
+ The evaluation metrics over training/eval
1134
+ data that were computed at the end of training.
1135
+ data_split_result (google.cloud.bigquery_v2.types.Model.DataSplitResult):
1136
+ Data split result of the training run. Only
1137
+ set when the input data is actually split.
1138
+ global_explanations (Sequence[google.cloud.bigquery_v2.types.Model.GlobalExplanation]):
1139
+ Global explanations for important features of
1140
+ the model. For multi-class models, there is one
1141
+ entry for each label class. For other models,
1142
+ there is only one entry in the list.
1143
+ """
1144
+
1145
+ class TrainingOptions(proto.Message):
1146
+ r"""Options used in model training.
1147
+
1148
+ Attributes:
1149
+ max_iterations (int):
1150
+ The maximum number of iterations in training.
1151
+ Used only for iterative training algorithms.
1152
+ loss_type (google.cloud.bigquery_v2.types.Model.LossType):
1153
+ Type of loss function used during training
1154
+ run.
1155
+ learn_rate (float):
1156
+ Learning rate in training. Used only for
1157
+ iterative training algorithms.
1158
+ l1_regularization (google.protobuf.wrappers_pb2.DoubleValue):
1159
+ L1 regularization coefficient.
1160
+ l2_regularization (google.protobuf.wrappers_pb2.DoubleValue):
1161
+ L2 regularization coefficient.
1162
+ min_relative_progress (google.protobuf.wrappers_pb2.DoubleValue):
1163
+ When early_stop is true, stops training when accuracy
1164
+ improvement is less than 'min_relative_progress'. Used only
1165
+ for iterative training algorithms.
1166
+ warm_start (google.protobuf.wrappers_pb2.BoolValue):
1167
+ Whether to train a model from the last
1168
+ checkpoint.
1169
+ early_stop (google.protobuf.wrappers_pb2.BoolValue):
1170
+ Whether to stop early when the loss doesn't improve
1171
+ significantly any more (compared to min_relative_progress).
1172
+ Used only for iterative training algorithms.
1173
+ input_label_columns (Sequence[str]):
1174
+ Name of input label columns in training data.
1175
+ data_split_method (google.cloud.bigquery_v2.types.Model.DataSplitMethod):
1176
+ The data split type for training and
1177
+ evaluation, e.g. RANDOM.
1178
+ data_split_eval_fraction (float):
1179
+ The fraction of evaluation data over the
1180
+ whole input data. The rest of data will be used
1181
+ as training data. The format should be double.
1182
+ Accurate to two decimal places.
1183
+ Default value is 0.2.
1184
+ data_split_column (str):
1185
+ The column to split data with. This column won't be used as
1186
+ a feature.
1187
+
1188
+ 1. When data_split_method is CUSTOM, the corresponding
1189
+ column should be boolean. The rows with true value tag
1190
+ are eval data, and the false are training data.
1191
+ 2. When data_split_method is SEQ, the first
1192
+ DATA_SPLIT_EVAL_FRACTION rows (from smallest to largest)
1193
+ in the corresponding column are used as training data,
1194
+ and the rest are eval data. It respects the order in
1195
+ Orderable data types:
1196
+ https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#data-type-properties
1197
+ learn_rate_strategy (google.cloud.bigquery_v2.types.Model.LearnRateStrategy):
1198
+ The strategy to determine learn rate for the
1199
+ current iteration.
1200
+ initial_learn_rate (float):
1201
+ Specifies the initial learning rate for the
1202
+ line search learn rate strategy.
1203
+ label_class_weights (Mapping[str, float]):
1204
+ Weights associated with each label class, for
1205
+ rebalancing the training data. Only applicable
1206
+ for classification models.
1207
+ user_column (str):
1208
+ User column specified for matrix
1209
+ factorization models.
1210
+ item_column (str):
1211
+ Item column specified for matrix
1212
+ factorization models.
1213
+ distance_type (google.cloud.bigquery_v2.types.Model.DistanceType):
1214
+ Distance type for clustering models.
1215
+ num_clusters (int):
1216
+ Number of clusters for clustering models.
1217
+ model_uri (str):
1218
+ Google Cloud Storage URI from which the model
1219
+ was imported. Only applicable for imported
1220
+ models.
1221
+ optimization_strategy (google.cloud.bigquery_v2.types.Model.OptimizationStrategy):
1222
+ Optimization strategy for training linear
1223
+ regression models.
1224
+ hidden_units (Sequence[int]):
1225
+ Hidden units for dnn models.
1226
+ batch_size (int):
1227
+ Batch size for dnn models.
1228
+ dropout (google.protobuf.wrappers_pb2.DoubleValue):
1229
+ Dropout probability for dnn models.
1230
+ max_tree_depth (int):
1231
+ Maximum depth of a tree for boosted tree
1232
+ models.
1233
+ subsample (float):
1234
+ Subsample fraction of the training data to
1235
+ grow tree to prevent overfitting for boosted
1236
+ tree models.
1237
+ min_split_loss (google.protobuf.wrappers_pb2.DoubleValue):
1238
+ Minimum split loss for boosted tree models.
1239
+ num_factors (int):
1240
+ Num factors specified for matrix
1241
+ factorization models.
1242
+ feedback_type (google.cloud.bigquery_v2.types.Model.FeedbackType):
1243
+ Feedback type that specifies which algorithm
1244
+ to run for matrix factorization.
1245
+ wals_alpha (google.protobuf.wrappers_pb2.DoubleValue):
1246
+ Hyperparameter for matrix factoration when
1247
+ implicit feedback type is specified.
1248
+ kmeans_initialization_method (google.cloud.bigquery_v2.types.Model.KmeansEnums.KmeansInitializationMethod):
1249
+ The method used to initialize the centroids
1250
+ for kmeans algorithm.
1251
+ kmeans_initialization_column (str):
1252
+ The column used to provide the initial centroids for kmeans
1253
+ algorithm when kmeans_initialization_method is CUSTOM.
1254
+ time_series_timestamp_column (str):
1255
+ Column to be designated as time series
1256
+ timestamp for ARIMA model.
1257
+ time_series_data_column (str):
1258
+ Column to be designated as time series data
1259
+ for ARIMA model.
1260
+ auto_arima (bool):
1261
+ Whether to enable auto ARIMA or not.
1262
+ non_seasonal_order (google.cloud.bigquery_v2.types.Model.ArimaOrder):
1263
+ A specification of the non-seasonal part of
1264
+ the ARIMA model: the three components (p, d, q)
1265
+ are the AR order, the degree of differencing,
1266
+ and the MA order.
1267
+ data_frequency (google.cloud.bigquery_v2.types.Model.DataFrequency):
1268
+ The data frequency of a time series.
1269
+ include_drift (bool):
1270
+ Include drift when fitting an ARIMA model.
1271
+ holiday_region (google.cloud.bigquery_v2.types.Model.HolidayRegion):
1272
+ The geographical region based on which the
1273
+ holidays are considered in time series modeling.
1274
+ If a valid value is specified, then holiday
1275
+ effects modeling is enabled.
1276
+ time_series_id_column (str):
1277
+ The time series id column that was used
1278
+ during ARIMA model training.
1279
+ time_series_id_columns (Sequence[str]):
1280
+ The time series id columns that were used
1281
+ during ARIMA model training.
1282
+ horizon (int):
1283
+ The number of periods ahead that need to be
1284
+ forecasted.
1285
+ preserve_input_structs (bool):
1286
+ Whether to preserve the input structs in output feature
1287
+ names. Suppose there is a struct A with field b. When false
1288
+ (default), the output feature name is A_b. When true, the
1289
+ output feature name is A.b.
1290
+ auto_arima_max_order (int):
1291
+ The max value of non-seasonal p and q.
1292
+ decompose_time_series (google.protobuf.wrappers_pb2.BoolValue):
1293
+ If true, perform decompose time series and
1294
+ save the results.
1295
+ clean_spikes_and_dips (google.protobuf.wrappers_pb2.BoolValue):
1296
+ If true, clean spikes and dips in the input
1297
+ time series.
1298
+ adjust_step_changes (google.protobuf.wrappers_pb2.BoolValue):
1299
+ If true, detect step changes and make data
1300
+ adjustment in the input time series.
1301
+ """
1302
+
1303
+ max_iterations = proto.Field(
1304
+ proto.INT64,
1305
+ number=1,
1306
+ )
1307
+ loss_type = proto.Field(
1308
+ proto.ENUM,
1309
+ number=2,
1310
+ enum="Model.LossType",
1311
+ )
1312
+ learn_rate = proto.Field(
1313
+ proto.DOUBLE,
1314
+ number=3,
1315
+ )
1316
+ l1_regularization = proto.Field(
1317
+ proto.MESSAGE,
1318
+ number=4,
1319
+ message=wrappers_pb2.DoubleValue,
1320
+ )
1321
+ l2_regularization = proto.Field(
1322
+ proto.MESSAGE,
1323
+ number=5,
1324
+ message=wrappers_pb2.DoubleValue,
1325
+ )
1326
+ min_relative_progress = proto.Field(
1327
+ proto.MESSAGE,
1328
+ number=6,
1329
+ message=wrappers_pb2.DoubleValue,
1330
+ )
1331
+ warm_start = proto.Field(
1332
+ proto.MESSAGE,
1333
+ number=7,
1334
+ message=wrappers_pb2.BoolValue,
1335
+ )
1336
+ early_stop = proto.Field(
1337
+ proto.MESSAGE,
1338
+ number=8,
1339
+ message=wrappers_pb2.BoolValue,
1340
+ )
1341
+ input_label_columns = proto.RepeatedField(
1342
+ proto.STRING,
1343
+ number=9,
1344
+ )
1345
+ data_split_method = proto.Field(
1346
+ proto.ENUM,
1347
+ number=10,
1348
+ enum="Model.DataSplitMethod",
1349
+ )
1350
+ data_split_eval_fraction = proto.Field(
1351
+ proto.DOUBLE,
1352
+ number=11,
1353
+ )
1354
+ data_split_column = proto.Field(
1355
+ proto.STRING,
1356
+ number=12,
1357
+ )
1358
+ learn_rate_strategy = proto.Field(
1359
+ proto.ENUM,
1360
+ number=13,
1361
+ enum="Model.LearnRateStrategy",
1362
+ )
1363
+ initial_learn_rate = proto.Field(
1364
+ proto.DOUBLE,
1365
+ number=16,
1366
+ )
1367
+ label_class_weights = proto.MapField(
1368
+ proto.STRING,
1369
+ proto.DOUBLE,
1370
+ number=17,
1371
+ )
1372
+ user_column = proto.Field(
1373
+ proto.STRING,
1374
+ number=18,
1375
+ )
1376
+ item_column = proto.Field(
1377
+ proto.STRING,
1378
+ number=19,
1379
+ )
1380
+ distance_type = proto.Field(
1381
+ proto.ENUM,
1382
+ number=20,
1383
+ enum="Model.DistanceType",
1384
+ )
1385
+ num_clusters = proto.Field(
1386
+ proto.INT64,
1387
+ number=21,
1388
+ )
1389
+ model_uri = proto.Field(
1390
+ proto.STRING,
1391
+ number=22,
1392
+ )
1393
+ optimization_strategy = proto.Field(
1394
+ proto.ENUM,
1395
+ number=23,
1396
+ enum="Model.OptimizationStrategy",
1397
+ )
1398
+ hidden_units = proto.RepeatedField(
1399
+ proto.INT64,
1400
+ number=24,
1401
+ )
1402
+ batch_size = proto.Field(
1403
+ proto.INT64,
1404
+ number=25,
1405
+ )
1406
+ dropout = proto.Field(
1407
+ proto.MESSAGE,
1408
+ number=26,
1409
+ message=wrappers_pb2.DoubleValue,
1410
+ )
1411
+ max_tree_depth = proto.Field(
1412
+ proto.INT64,
1413
+ number=27,
1414
+ )
1415
+ subsample = proto.Field(
1416
+ proto.DOUBLE,
1417
+ number=28,
1418
+ )
1419
+ min_split_loss = proto.Field(
1420
+ proto.MESSAGE,
1421
+ number=29,
1422
+ message=wrappers_pb2.DoubleValue,
1423
+ )
1424
+ num_factors = proto.Field(
1425
+ proto.INT64,
1426
+ number=30,
1427
+ )
1428
+ feedback_type = proto.Field(
1429
+ proto.ENUM,
1430
+ number=31,
1431
+ enum="Model.FeedbackType",
1432
+ )
1433
+ wals_alpha = proto.Field(
1434
+ proto.MESSAGE,
1435
+ number=32,
1436
+ message=wrappers_pb2.DoubleValue,
1437
+ )
1438
+ kmeans_initialization_method = proto.Field(
1439
+ proto.ENUM,
1440
+ number=33,
1441
+ enum="Model.KmeansEnums.KmeansInitializationMethod",
1442
+ )
1443
+ kmeans_initialization_column = proto.Field(
1444
+ proto.STRING,
1445
+ number=34,
1446
+ )
1447
+ time_series_timestamp_column = proto.Field(
1448
+ proto.STRING,
1449
+ number=35,
1450
+ )
1451
+ time_series_data_column = proto.Field(
1452
+ proto.STRING,
1453
+ number=36,
1454
+ )
1455
+ auto_arima = proto.Field(
1456
+ proto.BOOL,
1457
+ number=37,
1458
+ )
1459
+ non_seasonal_order = proto.Field(
1460
+ proto.MESSAGE,
1461
+ number=38,
1462
+ message="Model.ArimaOrder",
1463
+ )
1464
+ data_frequency = proto.Field(
1465
+ proto.ENUM,
1466
+ number=39,
1467
+ enum="Model.DataFrequency",
1468
+ )
1469
+ include_drift = proto.Field(
1470
+ proto.BOOL,
1471
+ number=41,
1472
+ )
1473
+ holiday_region = proto.Field(
1474
+ proto.ENUM,
1475
+ number=42,
1476
+ enum="Model.HolidayRegion",
1477
+ )
1478
+ time_series_id_column = proto.Field(
1479
+ proto.STRING,
1480
+ number=43,
1481
+ )
1482
+ time_series_id_columns = proto.RepeatedField(
1483
+ proto.STRING,
1484
+ number=51,
1485
+ )
1486
+ horizon = proto.Field(
1487
+ proto.INT64,
1488
+ number=44,
1489
+ )
1490
+ preserve_input_structs = proto.Field(
1491
+ proto.BOOL,
1492
+ number=45,
1493
+ )
1494
+ auto_arima_max_order = proto.Field(
1495
+ proto.INT64,
1496
+ number=46,
1497
+ )
1498
+ decompose_time_series = proto.Field(
1499
+ proto.MESSAGE,
1500
+ number=50,
1501
+ message=wrappers_pb2.BoolValue,
1502
+ )
1503
+ clean_spikes_and_dips = proto.Field(
1504
+ proto.MESSAGE,
1505
+ number=52,
1506
+ message=wrappers_pb2.BoolValue,
1507
+ )
1508
+ adjust_step_changes = proto.Field(
1509
+ proto.MESSAGE,
1510
+ number=53,
1511
+ message=wrappers_pb2.BoolValue,
1512
+ )
1513
+
1514
+ class IterationResult(proto.Message):
1515
+ r"""Information about a single iteration of the training run.
1516
+
1517
+ Attributes:
1518
+ index (google.protobuf.wrappers_pb2.Int32Value):
1519
+ Index of the iteration, 0 based.
1520
+ duration_ms (google.protobuf.wrappers_pb2.Int64Value):
1521
+ Time taken to run the iteration in
1522
+ milliseconds.
1523
+ training_loss (google.protobuf.wrappers_pb2.DoubleValue):
1524
+ Loss computed on the training data at the end
1525
+ of iteration.
1526
+ eval_loss (google.protobuf.wrappers_pb2.DoubleValue):
1527
+ Loss computed on the eval data at the end of
1528
+ iteration.
1529
+ learn_rate (float):
1530
+ Learn rate used for this iteration.
1531
+ cluster_infos (Sequence[google.cloud.bigquery_v2.types.Model.TrainingRun.IterationResult.ClusterInfo]):
1532
+ Information about top clusters for clustering
1533
+ models.
1534
+ arima_result (google.cloud.bigquery_v2.types.Model.TrainingRun.IterationResult.ArimaResult):
1535
+
1536
+ """
1537
+
1538
+ class ClusterInfo(proto.Message):
1539
+ r"""Information about a single cluster for clustering model.
1540
+
1541
+ Attributes:
1542
+ centroid_id (int):
1543
+ Centroid id.
1544
+ cluster_radius (google.protobuf.wrappers_pb2.DoubleValue):
1545
+ Cluster radius, the average distance from
1546
+ centroid to each point assigned to the cluster.
1547
+ cluster_size (google.protobuf.wrappers_pb2.Int64Value):
1548
+ Cluster size, the total number of points
1549
+ assigned to the cluster.
1550
+ """
1551
+
1552
+ centroid_id = proto.Field(
1553
+ proto.INT64,
1554
+ number=1,
1555
+ )
1556
+ cluster_radius = proto.Field(
1557
+ proto.MESSAGE,
1558
+ number=2,
1559
+ message=wrappers_pb2.DoubleValue,
1560
+ )
1561
+ cluster_size = proto.Field(
1562
+ proto.MESSAGE,
1563
+ number=3,
1564
+ message=wrappers_pb2.Int64Value,
1565
+ )
1566
+
1567
+ class ArimaResult(proto.Message):
1568
+ r"""(Auto-)arima fitting result. Wrap everything in ArimaResult
1569
+ for easier refactoring if we want to use model-specific
1570
+ iteration results.
1571
+
1572
+ Attributes:
1573
+ arima_model_info (Sequence[google.cloud.bigquery_v2.types.Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo]):
1574
+ This message is repeated because there are
1575
+ multiple arima models fitted in auto-arima. For
1576
+ non-auto-arima model, its size is one.
1577
+ seasonal_periods (Sequence[google.cloud.bigquery_v2.types.Model.SeasonalPeriod.SeasonalPeriodType]):
1578
+ Seasonal periods. Repeated because multiple
1579
+ periods are supported for one time series.
1580
+ """
1581
+
1582
+ class ArimaCoefficients(proto.Message):
1583
+ r"""Arima coefficients.
1584
+
1585
+ Attributes:
1586
+ auto_regressive_coefficients (Sequence[float]):
1587
+ Auto-regressive coefficients, an array of
1588
+ double.
1589
+ moving_average_coefficients (Sequence[float]):
1590
+ Moving-average coefficients, an array of
1591
+ double.
1592
+ intercept_coefficient (float):
1593
+ Intercept coefficient, just a double not an
1594
+ array.
1595
+ """
1596
+
1597
+ auto_regressive_coefficients = proto.RepeatedField(
1598
+ proto.DOUBLE,
1599
+ number=1,
1600
+ )
1601
+ moving_average_coefficients = proto.RepeatedField(
1602
+ proto.DOUBLE,
1603
+ number=2,
1604
+ )
1605
+ intercept_coefficient = proto.Field(
1606
+ proto.DOUBLE,
1607
+ number=3,
1608
+ )
1609
+
1610
+ class ArimaModelInfo(proto.Message):
1611
+ r"""Arima model information.
1612
+
1613
+ Attributes:
1614
+ non_seasonal_order (google.cloud.bigquery_v2.types.Model.ArimaOrder):
1615
+ Non-seasonal order.
1616
+ arima_coefficients (google.cloud.bigquery_v2.types.Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients):
1617
+ Arima coefficients.
1618
+ arima_fitting_metrics (google.cloud.bigquery_v2.types.Model.ArimaFittingMetrics):
1619
+ Arima fitting metrics.
1620
+ has_drift (bool):
1621
+ Whether Arima model fitted with drift or not.
1622
+ It is always false when d is not 1.
1623
+ time_series_id (str):
1624
+ The time_series_id value for this time series. It will be
1625
+ one of the unique values from the time_series_id_column
1626
+ specified during ARIMA model training. Only present when
1627
+ time_series_id_column training option was used.
1628
+ time_series_ids (Sequence[str]):
1629
+ The tuple of time_series_ids identifying this time series.
1630
+ It will be one of the unique tuples of values present in the
1631
+ time_series_id_columns specified during ARIMA model
1632
+ training. Only present when time_series_id_columns training
1633
+ option was used and the order of values here are same as the
1634
+ order of time_series_id_columns.
1635
+ seasonal_periods (Sequence[google.cloud.bigquery_v2.types.Model.SeasonalPeriod.SeasonalPeriodType]):
1636
+ Seasonal periods. Repeated because multiple
1637
+ periods are supported for one time series.
1638
+ has_holiday_effect (google.protobuf.wrappers_pb2.BoolValue):
1639
+ If true, holiday_effect is a part of time series
1640
+ decomposition result.
1641
+ has_spikes_and_dips (google.protobuf.wrappers_pb2.BoolValue):
1642
+ If true, spikes_and_dips is a part of time series
1643
+ decomposition result.
1644
+ has_step_changes (google.protobuf.wrappers_pb2.BoolValue):
1645
+ If true, step_changes is a part of time series decomposition
1646
+ result.
1647
+ """
1648
+
1649
+ non_seasonal_order = proto.Field(
1650
+ proto.MESSAGE,
1651
+ number=1,
1652
+ message="Model.ArimaOrder",
1653
+ )
1654
+ arima_coefficients = proto.Field(
1655
+ proto.MESSAGE,
1656
+ number=2,
1657
+ message="Model.TrainingRun.IterationResult.ArimaResult.ArimaCoefficients",
1658
+ )
1659
+ arima_fitting_metrics = proto.Field(
1660
+ proto.MESSAGE,
1661
+ number=3,
1662
+ message="Model.ArimaFittingMetrics",
1663
+ )
1664
+ has_drift = proto.Field(
1665
+ proto.BOOL,
1666
+ number=4,
1667
+ )
1668
+ time_series_id = proto.Field(
1669
+ proto.STRING,
1670
+ number=5,
1671
+ )
1672
+ time_series_ids = proto.RepeatedField(
1673
+ proto.STRING,
1674
+ number=10,
1675
+ )
1676
+ seasonal_periods = proto.RepeatedField(
1677
+ proto.ENUM,
1678
+ number=6,
1679
+ enum="Model.SeasonalPeriod.SeasonalPeriodType",
1680
+ )
1681
+ has_holiday_effect = proto.Field(
1682
+ proto.MESSAGE,
1683
+ number=7,
1684
+ message=wrappers_pb2.BoolValue,
1685
+ )
1686
+ has_spikes_and_dips = proto.Field(
1687
+ proto.MESSAGE,
1688
+ number=8,
1689
+ message=wrappers_pb2.BoolValue,
1690
+ )
1691
+ has_step_changes = proto.Field(
1692
+ proto.MESSAGE,
1693
+ number=9,
1694
+ message=wrappers_pb2.BoolValue,
1695
+ )
1696
+
1697
+ arima_model_info = proto.RepeatedField(
1698
+ proto.MESSAGE,
1699
+ number=1,
1700
+ message="Model.TrainingRun.IterationResult.ArimaResult.ArimaModelInfo",
1701
+ )
1702
+ seasonal_periods = proto.RepeatedField(
1703
+ proto.ENUM,
1704
+ number=2,
1705
+ enum="Model.SeasonalPeriod.SeasonalPeriodType",
1706
+ )
1707
+
1708
+ index = proto.Field(
1709
+ proto.MESSAGE,
1710
+ number=1,
1711
+ message=wrappers_pb2.Int32Value,
1712
+ )
1713
+ duration_ms = proto.Field(
1714
+ proto.MESSAGE,
1715
+ number=4,
1716
+ message=wrappers_pb2.Int64Value,
1717
+ )
1718
+ training_loss = proto.Field(
1719
+ proto.MESSAGE,
1720
+ number=5,
1721
+ message=wrappers_pb2.DoubleValue,
1722
+ )
1723
+ eval_loss = proto.Field(
1724
+ proto.MESSAGE,
1725
+ number=6,
1726
+ message=wrappers_pb2.DoubleValue,
1727
+ )
1728
+ learn_rate = proto.Field(
1729
+ proto.DOUBLE,
1730
+ number=7,
1731
+ )
1732
+ cluster_infos = proto.RepeatedField(
1733
+ proto.MESSAGE,
1734
+ number=8,
1735
+ message="Model.TrainingRun.IterationResult.ClusterInfo",
1736
+ )
1737
+ arima_result = proto.Field(
1738
+ proto.MESSAGE,
1739
+ number=9,
1740
+ message="Model.TrainingRun.IterationResult.ArimaResult",
1741
+ )
1742
+
1743
+ training_options = proto.Field(
1744
+ proto.MESSAGE,
1745
+ number=1,
1746
+ message="Model.TrainingRun.TrainingOptions",
1747
+ )
1748
+ start_time = proto.Field(
1749
+ proto.MESSAGE,
1750
+ number=8,
1751
+ message=timestamp_pb2.Timestamp,
1752
+ )
1753
+ results = proto.RepeatedField(
1754
+ proto.MESSAGE,
1755
+ number=6,
1756
+ message="Model.TrainingRun.IterationResult",
1757
+ )
1758
+ evaluation_metrics = proto.Field(
1759
+ proto.MESSAGE,
1760
+ number=7,
1761
+ message="Model.EvaluationMetrics",
1762
+ )
1763
+ data_split_result = proto.Field(
1764
+ proto.MESSAGE,
1765
+ number=9,
1766
+ message="Model.DataSplitResult",
1767
+ )
1768
+ global_explanations = proto.RepeatedField(
1769
+ proto.MESSAGE,
1770
+ number=10,
1771
+ message="Model.GlobalExplanation",
1772
+ )
1773
+
1774
+ etag = proto.Field(
1775
+ proto.STRING,
1776
+ number=1,
1777
+ )
1778
+ model_reference = proto.Field(
1779
+ proto.MESSAGE,
1780
+ number=2,
1781
+ message=gcb_model_reference.ModelReference,
1782
+ )
1783
+ creation_time = proto.Field(
1784
+ proto.INT64,
1785
+ number=5,
1786
+ )
1787
+ last_modified_time = proto.Field(
1788
+ proto.INT64,
1789
+ number=6,
1790
+ )
1791
+ description = proto.Field(
1792
+ proto.STRING,
1793
+ number=12,
1794
+ )
1795
+ friendly_name = proto.Field(
1796
+ proto.STRING,
1797
+ number=14,
1798
+ )
1799
+ labels = proto.MapField(
1800
+ proto.STRING,
1801
+ proto.STRING,
1802
+ number=15,
1803
+ )
1804
+ expiration_time = proto.Field(
1805
+ proto.INT64,
1806
+ number=16,
1807
+ )
1808
+ location = proto.Field(
1809
+ proto.STRING,
1810
+ number=13,
1811
+ )
1812
+ encryption_configuration = proto.Field(
1813
+ proto.MESSAGE,
1814
+ number=17,
1815
+ message=encryption_config.EncryptionConfiguration,
1816
+ )
1817
+ model_type = proto.Field(
1818
+ proto.ENUM,
1819
+ number=7,
1820
+ enum=ModelType,
1821
+ )
1822
+ training_runs = proto.RepeatedField(
1823
+ proto.MESSAGE,
1824
+ number=9,
1825
+ message=TrainingRun,
1826
+ )
1827
+ feature_columns = proto.RepeatedField(
1828
+ proto.MESSAGE,
1829
+ number=10,
1830
+ message=standard_sql.StandardSqlField,
1831
+ )
1832
+ label_columns = proto.RepeatedField(
1833
+ proto.MESSAGE,
1834
+ number=11,
1835
+ message=standard_sql.StandardSqlField,
1836
+ )
1837
+ best_trial_id = proto.Field(
1838
+ proto.INT64,
1839
+ number=19,
1840
+ )
1841
+
1842
+
1843
+ class GetModelRequest(proto.Message):
1844
+ r"""
1845
+
1846
+ Attributes:
1847
+ project_id (str):
1848
+ Required. Project ID of the requested model.
1849
+ dataset_id (str):
1850
+ Required. Dataset ID of the requested model.
1851
+ model_id (str):
1852
+ Required. Model ID of the requested model.
1853
+ """
1854
+
1855
+ project_id = proto.Field(
1856
+ proto.STRING,
1857
+ number=1,
1858
+ )
1859
+ dataset_id = proto.Field(
1860
+ proto.STRING,
1861
+ number=2,
1862
+ )
1863
+ model_id = proto.Field(
1864
+ proto.STRING,
1865
+ number=3,
1866
+ )
1867
+
1868
+
1869
+ class PatchModelRequest(proto.Message):
1870
+ r"""
1871
+
1872
+ Attributes:
1873
+ project_id (str):
1874
+ Required. Project ID of the model to patch.
1875
+ dataset_id (str):
1876
+ Required. Dataset ID of the model to patch.
1877
+ model_id (str):
1878
+ Required. Model ID of the model to patch.
1879
+ model (google.cloud.bigquery_v2.types.Model):
1880
+ Required. Patched model.
1881
+ Follows RFC5789 patch semantics. Missing fields
1882
+ are not updated. To clear a field, explicitly
1883
+ set to default value.
1884
+ """
1885
+
1886
+ project_id = proto.Field(
1887
+ proto.STRING,
1888
+ number=1,
1889
+ )
1890
+ dataset_id = proto.Field(
1891
+ proto.STRING,
1892
+ number=2,
1893
+ )
1894
+ model_id = proto.Field(
1895
+ proto.STRING,
1896
+ number=3,
1897
+ )
1898
+ model = proto.Field(
1899
+ proto.MESSAGE,
1900
+ number=4,
1901
+ message="Model",
1902
+ )
1903
+
1904
+
1905
+ class DeleteModelRequest(proto.Message):
1906
+ r"""
1907
+
1908
+ Attributes:
1909
+ project_id (str):
1910
+ Required. Project ID of the model to delete.
1911
+ dataset_id (str):
1912
+ Required. Dataset ID of the model to delete.
1913
+ model_id (str):
1914
+ Required. Model ID of the model to delete.
1915
+ """
1916
+
1917
+ project_id = proto.Field(
1918
+ proto.STRING,
1919
+ number=1,
1920
+ )
1921
+ dataset_id = proto.Field(
1922
+ proto.STRING,
1923
+ number=2,
1924
+ )
1925
+ model_id = proto.Field(
1926
+ proto.STRING,
1927
+ number=3,
1928
+ )
1929
+
1930
+
1931
+ class ListModelsRequest(proto.Message):
1932
+ r"""
1933
+
1934
+ Attributes:
1935
+ project_id (str):
1936
+ Required. Project ID of the models to list.
1937
+ dataset_id (str):
1938
+ Required. Dataset ID of the models to list.
1939
+ max_results (google.protobuf.wrappers_pb2.UInt32Value):
1940
+ The maximum number of results to return in a
1941
+ single response page. Leverage the page tokens
1942
+ to iterate through the entire collection.
1943
+ page_token (str):
1944
+ Page token, returned by a previous call to
1945
+ request the next page of results
1946
+ """
1947
+
1948
+ project_id = proto.Field(
1949
+ proto.STRING,
1950
+ number=1,
1951
+ )
1952
+ dataset_id = proto.Field(
1953
+ proto.STRING,
1954
+ number=2,
1955
+ )
1956
+ max_results = proto.Field(
1957
+ proto.MESSAGE,
1958
+ number=3,
1959
+ message=wrappers_pb2.UInt32Value,
1960
+ )
1961
+ page_token = proto.Field(
1962
+ proto.STRING,
1963
+ number=4,
1964
+ )
1965
+
1966
+
1967
+ class ListModelsResponse(proto.Message):
1968
+ r"""
1969
+
1970
+ Attributes:
1971
+ models (Sequence[google.cloud.bigquery_v2.types.Model]):
1972
+ Models in the requested dataset. Only the following fields
1973
+ are populated: model_reference, model_type, creation_time,
1974
+ last_modified_time and labels.
1975
+ next_page_token (str):
1976
+ A token to request the next page of results.
1977
+ """
1978
+
1979
+ @property
1980
+ def raw_page(self):
1981
+ return self
1982
+
1983
+ models = proto.RepeatedField(
1984
+ proto.MESSAGE,
1985
+ number=1,
1986
+ message="Model",
1987
+ )
1988
+ next_page_token = proto.Field(
1989
+ proto.STRING,
1990
+ number=2,
1991
+ )
1992
+
1993
+
1994
+ __all__ = tuple(sorted(__protobuf__.manifest))